Module: Jacaranda::ClassMethods

Defined in:
lib/jacaranda/base.rb,
lib/jacaranda/scope.rb,
lib/jacaranda/predicate.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_jacaranda(options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/jacaranda/base.rb', line 9

def acts_as_jacaranda(options = {})
  configuration.update(options)
  begin
    verify!
    create_predicate_methods
    create_scope_methods
  rescue => e
    if e.kind_of?(Jacaranda::JacarandaError)
      raise e
    else
      raise Jacaranda::JacarandaError, I18n.translate("jacaranda.errors.messages.unknown")
    end
  end
end