Module: Para::ActiveRecordOrderableMixin::ClassMethods
- Defined in:
- lib/para/orderable.rb
Instance Method Summary collapse
Instance Method Details
#acts_as_orderable(options = {}) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/para/orderable.rb', line 55 def acts_as_orderable( = {}) return if orderable? unless ( ( [:parent] && [:as]) || (![:parent] && ![:as]) ) raise "You need to either pass :parent and :as options to the " \ "acts_as_orderable macro, or no options at all." end self.orderable = true self. = include Para::Orderable end |
#orderable? ⇒ Boolean
71 72 73 |
# File 'lib/para/orderable.rb', line 71 def orderable? !!orderable end |