Module: Enumerize::Scope::Mongoid

Defined in:
lib/enumerize/scope/mongoid.rb

Instance Method Summary collapse

Instance Method Details

#enumerize(name, options = {}) ⇒ Object


6
7
8
9
10
11
12
13
14
15
16
# File 'lib/enumerize/scope/mongoid.rb', line 6

def enumerize(name, options={})
  super

  _enumerize_module.dependent_eval do
    if self < ::Mongoid::Document
      if options[:scope]
        _define_mongoid_scope_methods!(name, options)
      end
    end
  end
end