Module: MongoModel::Scope::LoadMethods

Included in:
MongoModel::Scope
Defined in:
lib/mongomodel/support/scope/load_methods.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#on_load_procObject

Returns the value of attribute on_load_proc



4
5
6
# File 'lib/mongomodel/support/scope/load_methods.rb', line 4

def on_load_proc
  @on_load_proc
end

Instance Method Details

#on_load(&block) ⇒ Object



6
7
8
9
10
# File 'lib/mongomodel/support/scope/load_methods.rb', line 6

def on_load(&block)
  new_scope = clone
  new_scope.on_load_proc = block
  new_scope
end