Module: Enumerize::Scope::Mongoid

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

Instance Method Summary collapse

Instance Method Details

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



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

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