Module: Anoubis::HasManualOrder::ClassMethods

Defined in:
lib/anoubis.rb

Instance Method Summary collapse

Instance Method Details

#has_manual_order(params = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/anoubis.rb', line 14

def has_manual_order(params = {})
  send :cattr_accessor, :manual_order_options
  send :before_create, :manual_order_before_create_element
  send :before_update, :manual_order_before_update_element
  send :after_save, :manual_order_after_save_element
  send :after_destroy, :manual_order_after_destroy

  self.manual_order_options = params if params.is_a?(Hash)
  include Anoubis::HasManualOrder::LocalInstanceMethods
end