Class: Integral::Object
- Inherits:
-
ListItem
- Object
- ActiveRecord::Base
- ApplicationRecord
- ListItem
- Integral::Object
- Defined in:
- app/models/integral/object.rb
Overview
List item which is linked to a particular object i.e. A Post
Instance Method Summary collapse
-
#object ⇒ Object
The object associated with the list item.
-
#object=(object) ⇒ Object
Sets the related object.
- #object? ⇒ Boolean
Methods inherited from ListItem
#basic?, #has_children?, #link?, types_collection
Methods inherited from ApplicationRecord
Instance Method Details
#object ⇒ Object
Returns the object associated with the list item.
12 13 14 |
# File 'app/models/integral/object.rb', line 12 def object @object ||= object_klass.find_by_id(object_id) end |
#object=(object) ⇒ Object
Sets the related object
17 18 19 20 |
# File 'app/models/integral/object.rb', line 17 def object=(object) self.object_id = object.id self.object_type = object.class end |
#object? ⇒ Boolean
7 8 9 |
# File 'app/models/integral/object.rb', line 7 def object? true end |