Module: Model::ClassMethods

Defined in:
lib/aerogel/core/db/model.rb

Instance Method Summary collapse

Instance Method Details

#find!(*args) ⇒ Object

Finds document by id. Raises error if document is not found.



19
20
21
22
23
24
25
26
27
# File 'lib/aerogel/core/db/model.rb', line 19

def find!( *args )
  raise_not_found_error_was = Mongoid.raise_not_found_error
  begin
    Mongoid.raise_not_found_error = true
    self.find( *args )
  ensure
    Mongoid.raise_not_found_error = raise_not_found_error_was
  end
end