Permalink
Browse files

Less obtrusive monkey patching...if there is such a thing.

  • Loading branch information...
1 parent 2c45cb7 commit f4986e30acabf54c39af014e64026a073b76b07c @jnunemaker committed Mar 14, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/toy/extensions/bson_object_id.rb
@@ -1,9 +1,13 @@
-class BSON::ObjectId
- def self.to_store(value, *)
+module ObjectIdConversions
+ def to_store(value, *)
Plucky.to_object_id(value)
end
- def self.from_store(value, *args)
+ def from_store(value, *)
Plucky.to_object_id(value)
end
end
+
+class BSON::ObjectId
+ extend ObjectIdConversions
+end

0 comments on commit f4986e3

Please sign in to comment.