lib/ahoy/stores/mongoid_store.rb in ahoy_matey-1.0.1 vs lib/ahoy/stores/mongoid_store.rb in ahoy_matey-1.0.2
- old
+ new
@@ -49,10 +49,17 @@
def event_model
::Ahoy::Event
end
def binary(token)
- ::BSON::Binary.new(token.delete("-"), :uuid)
+ token = token.delete("-")
+ if defined?(::BSON)
+ ::BSON::Binary.new(token, :uuid)
+ elsif defined?(::Moped::BSON)
+ ::Moped::BSON::Binary.new(:uuid, token)
+ else
+ token
+ end
end
end
end
end