Class: Mongoid::Relations::Metadata
- Inherits:
-
Object
- Object
- Mongoid::Relations::Metadata
- Defined in:
- lib/mongoid_sortable_relation/metadata.rb
Instance Method Summary collapse
Instance Method Details
#sortable ⇒ Object
6 7 8 |
# File 'lib/mongoid_sortable_relation/metadata.rb', line 6 def sortable self[:sortable] end |
#sortable? ⇒ Boolean
10 11 12 |
# File 'lib/mongoid_sortable_relation/metadata.rb', line 10 def sortable? !!sortable end |
#sortable_field ⇒ Object
14 15 16 |
# File 'lib/mongoid_sortable_relation/metadata.rb', line 14 def sortable_field :"#{prefix}_position" end |
#sortable_scope ⇒ Object
18 19 20 |
# File 'lib/mongoid_sortable_relation/metadata.rb', line 18 def sortable_scope :"sort_for_#{prefix}" end |