Class: Area

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
FriendlyId
Includes:
Applicat::Mvc::Model::Resource::Base, Applicat::Mvc::Model::Tokenable, Applicat::Mvc::Model::Tree
Defined in:
app/models/area.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Applicat::Mvc::Model::Tree

included

Methods included from Applicat::Mvc::Model::Resource::Base

included

Class Method Details

.find_by_product_id(product_id) ⇒ Object



28
29
30
# File 'app/models/area.rb', line 28

def self.find_by_product_id(product_id)
  roots.with_projects_for_product(product_id)
end

Instance Method Details

#children_for_product_id(product_id) ⇒ Object



32
33
34
35
# File 'app/models/area.rb', line 32

def children_for_product_id(product_id)
  #children.joins(:projects).merge(Project.for_product_id(product_id))
  children.with_projects_for_product(product_id)
end

#productsObject



37
38
# File 'app/models/area.rb', line 37

def products
end