Class: PageAttachment
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- PageAttachment
- Defined in:
- app/models/page_attachment.rb
Instance Attribute Summary collapse
-
#selected ⇒ Object
Returns the value of attribute selected.
Instance Method Summary collapse
-
#add_to_list_bottom ⇒ Object
a small change to the method in acts_as_list so that we don’t override the position value if it has already been set (as it usually is for new attachments).
- #selected? ⇒ Boolean
Instance Attribute Details
#selected ⇒ Object
Returns the value of attribute selected.
4 5 6 |
# File 'app/models/page_attachment.rb', line 4 def selected @selected end |
Instance Method Details
#add_to_list_bottom ⇒ Object
a small change to the method in acts_as_list so that we don’t override the position value if it has already been set (as it usually is for new attachments)
16 17 18 |
# File 'app/models/page_attachment.rb', line 16 def add_to_list_bottom self[position_column] ||= bottom_position_in_list.to_i + 1 end |
#selected? ⇒ Boolean
10 11 12 |
# File 'app/models/page_attachment.rb', line 10 def selected? !!selected end |