Class: Comment
Constant Summary
Constants inherited from Item
Item::ALLOWED_KEYS, Item::PER_PAGE, Item::TEASER_LENGTH
Instance Attribute Summary collapse
-
#item_id ⇒ Object
Returns the value of attribute item_id.
Attributes inherited from Item
#comments_count, #layout, #name, #teaser, #text
Instance Method Summary collapse
Methods inherited from Item
#comments, #generate_teaser!, #to_json, #to_param
Instance Attribute Details
#item_id ⇒ Object
Returns the value of attribute item_id.
3 4 5 |
# File 'app/models/comment.rb', line 3 def item_id @item_id end |
Instance Method Details
#item ⇒ Object
9 10 11 |
# File 'app/models/comment.rb', line 9 def item _cache[:item] ||= Item.by_id item_id end |
#item=(item) ⇒ Object
5 6 7 8 |
# File 'app/models/comment.rb', line 5 def item= item self.item_id = item._id _cache[:item] = item end |