module Tracco::MongoidHelper

Public Instance Methods

without_mongo_raising_errors(&block) click to toggle source
# File lib/tracco/mongoid_helper.rb, line 4
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