Sha256: e856bef45353f2d9ccf1ad35c092ed4455456155d89b3a1894f39464b07fd5ac

Contents?: true

Size: 299 Bytes

Versions: 12

Compression:

Stored size: 299 Bytes

Contents

module MongoModel
  module Types
    class Array < Object
      def to_mongo(array)
        array.map { |i| convert(i) } if array
      end
      
      def to_query(value)
        convert(value)
      end
    end
  end
end

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

Version data entries

12 entries across 12 versions & 1 rubygems

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