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)
39 40 41 42 43 |
# File 'app/models/project.rb', line 39 def product return @product if @product @product = product_id.blank? ? nil : Product.find(product_id) end |
#product=(document) ⇒ Object
45 46 47 48 |
# File 'app/models/project.rb', line 45 def product=(document) @product = document self.product_id = @product.try(:id) end |
#stories ⇒ Object
59 |
# File 'app/models/project.rb', line 59 def stories; story_class.where(project_id: id); end |