lib/mongo_mapper/extensions/string.rb in mongo_mapper-0.13.1 vs lib/mongo_mapper/extensions/string.rb in mongo_mapper-0.14.0.rc1
- old
+ new
@@ -1,18 +1,26 @@
# encoding: UTF-8
module MongoMapper
module Extensions
module String
- def to_mongo(value)
- value && value.to_s
+ extend ActiveSupport::Concern
+
+ module ClassMethods
+ def to_mongo(value)
+ value && value.to_s
+ end
+
+ def from_mongo(value)
+ value && value.to_s
+ end
end
- def from_mongo(value)
- value && value.to_s
+ def _mongo_mapper_deep_copy_
+ self.dup
end
end
end
end
class String
- extend MongoMapper::Extensions::String
+ include MongoMapper::Extensions::String
end
\ No newline at end of file