Sha256: 704c931ebe00026062e2ef410ab7bc5cbf359272fed630997b9a003311524299

Contents?: true

Size: 242 Bytes

Versions: 14

Compression:

Stored size: 242 Bytes

Contents

module MongoModel
  module Types
    class String < Object
      def cast(value)
        value.to_s if value && value.respond_to?(:to_s)
      end
    end
  end
end

MongoModel::Types.register_converter(String, MongoModel::Types::String.new)

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mongomodel-0.5.7 lib/mongomodel/support/types/string.rb
mongomodel-0.5.6 lib/mongomodel/support/types/string.rb
mongomodel-0.5.5 lib/mongomodel/support/types/string.rb
mongomodel-0.5.4 lib/mongomodel/support/types/string.rb
mongomodel-0.5.3 lib/mongomodel/support/types/string.rb
mongomodel-0.5.2 lib/mongomodel/support/types/string.rb
mongomodel-0.5.1 lib/mongomodel/support/types/string.rb
mongomodel-0.5.0 lib/mongomodel/support/types/string.rb
mongomodel-0.4.9 lib/mongomodel/support/types/string.rb
mongomodel-0.4.8 lib/mongomodel/support/types/string.rb
mongomodel-0.4.7 lib/mongomodel/support/types/string.rb
mongomodel-0.4.6 lib/mongomodel/support/types/string.rb
mongomodel-0.4.5 lib/mongomodel/support/types/string.rb
mongomodel-0.4.4 lib/mongomodel/support/types/string.rb