Created
May 6, 2014 04:10
-
-
Save gevans/d070ca040da979a2b03f to your computer and use it in GitHub Desktop.
Revisions
-
gevans created this gist
May 6, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ module Extensions module HashWithIndifferentAccess def mongoize ::HashWithIndifferentAccess.mongoize(self) end module ClassMethods def demongoize(object) ::Hash.demongoize(object).try(:with_indifferent_access) end def mongoize(object) ::Hash.mongoize(object) end end # ClassMethods end # HashWithIndifferentAccess end # Extensions ::HashWithIndifferentAccess.__send__(:include, Extensions::HashWithIndifferentAccess) ::HashWithIndifferentAccess.extend(Extensions::HashWithIndifferentAccess::ClassMethods)