Module: MongoidHelper

Included in:
TrackedCard
Defined in:
lib/trello_effort_tracker/mongoid_helper.rb

Instance Method Summary collapse

Instance Method Details

#without_mongo_raising_errors(&block) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/trello_effort_tracker/mongoid_helper.rb', line 3

def without_mongo_raising_errors(&block)
  original_value = Mongoid.raise_not_found_error
  Mongoid.raise_not_found_error = false
  begin
    block.call if block
  ensure
    Mongoid.raise_not_found_error = original_value
  end
end