Class: PageAttachment

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/page_attachment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#selectedObject

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_bottomObject

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

Returns:

  • (Boolean)


10
11
12
# File 'app/models/page_attachment.rb', line 10

def selected?
  !!selected
end