Sha256: 39ffe5bc8956a3209f3ee8a591e5c2094f1ca0cfcde593541748208e0fda482d

Contents?: true

Size: 431 Bytes

Versions: 6

Compression:

Stored size: 431 Bytes

Contents

# encoding: UTF-8
module MongoMapper
  module Extensions
    module String
      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 _mongo_mapper_deep_copy_
        self.dup
      end
    end
  end
end

class String
  include MongoMapper::Extensions::String
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mongo_mapper-0.15.3 lib/mongo_mapper/extensions/string.rb
mongo_mapper-0.15.2 lib/mongo_mapper/extensions/string.rb
mongo_mapper-0.15.1 lib/mongo_mapper/extensions/string.rb
mongo_mapper-0.15.0 lib/mongo_mapper/extensions/string.rb
mongo_mapper-0.14.0 lib/mongo_mapper/extensions/string.rb
mongo_mapper-0.14.0.rc1 lib/mongo_mapper/extensions/string.rb