Sha256: 43474ca1273ba76bc274225e18350e199e481914775af10a875865352335473c
Contents?: true
Size: 640 Bytes
Versions: 21
Compression:
Stored size: 640 Bytes
Contents
require 'mongoid' module RailsAdmin module Adapters module Mongoid class Bson OBJECT_ID = begin if defined?(Moped::BSON) Moped::BSON::ObjectId elsif defined?(BSON::ObjectId) BSON::ObjectId end end class << self def parse_object_id(value) OBJECT_ID.from_string(value) rescue => e raise e if %w( Moped::Errors::InvalidObjectId BSON::ObjectId::Invalid BSON::InvalidObjectId ).exclude?(e.class.to_s) end end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems