Skip to content

Commit

Permalink
Less obtrusive monkey patching...if there is such a thing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Mar 14, 2012
1 parent 2c45cb7 commit f4986e3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/toy/extensions/bson_object_id.rb
Original file line number Diff line number Diff line change
@@ -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.