Class: Project
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Project
- Extended by:
- FriendlyId
- Defined in:
- app/models/project.rb
Constant Summary collapse
- PARENT_TYPES =
['area', 'product', 'user', 'organization']
Instance Method Summary collapse
-
#product ⇒ Object
belongs_to (Mongo DB).
- #product=(document) ⇒ Object
- #stories ⇒ Object
-
#story_class ⇒ Object
has_many (Mongo DB).
Instance Method Details
#product ⇒ Object
belongs_to (Mongo DB)
37 38 39 40 41 |
# File 'app/models/project.rb', line 37 def product return @product if @product @product = product_id.blank? ? nil : Product.find(product_id) end |
#product=(document) ⇒ Object
43 44 45 46 |
# File 'app/models/project.rb', line 43 def product=(document) @product = document self.product_id = @product.try(:id) end |
#stories ⇒ Object
57 |
# File 'app/models/project.rb', line 57 def stories; story_class.where(project_id: id); end |