Sha256: e2af14aa3e9c58c719e2dce9a3fe0bf96f6072e0c8e5e5885c3b05c6ecbf09e8

Contents?: true

Size: 326 Bytes

Versions: 75

Compression:

Stored size: 326 Bytes

Contents

# encoding: UTF-8
module MongoMapper
  module Extensions
    module Array
      def to_mongo(value)
        value = value.respond_to?(:lines) ? value.lines : value
        value.to_a
      end

      def from_mongo(value)
        value || []
      end
    end
  end
end

class Array
  extend MongoMapper::Extensions::Array
end

Version data entries

75 entries across 75 versions & 9 rubygems

Version Path
mongo_mapper-0.13.1 lib/mongo_mapper/extensions/array.rb
mongo_mapper-0.13.0 lib/mongo_mapper/extensions/array.rb
mongo_mapper-0.13.0.beta2 lib/mongo_mapper/extensions/array.rb
mongo_mapper-0.13.0.beta1 lib/mongo_mapper/extensions/array.rb
mongo_mapper-0.12.0 lib/mongo_mapper/extensions/array.rb
lookout-mongo_mapper-0.11.3 lib/mongo_mapper/extensions/array.rb
mongo_mapper-0.11.2 lib/mongo_mapper/extensions/array.rb
jamieorc-mongo_mapper-0.11.1.1 lib/mongo_mapper/extensions/array.rb
mongo_mapper-0.11.1 lib/mongo_mapper/extensions/array.rb
mongo_mapper-0.11.0 lib/mongo_mapper/extensions/array.rb
mongo_mapper-0.10.1 lib/mongo_mapper/extensions/array.rb
mongo_mapper-0.10.0 lib/mongo_mapper/extensions/array.rb
mongo_mapper-0.9.2 lib/mongo_mapper/extensions/array.rb
jonbell-mongo_mapper-0.8.6 lib/mongo_mapper/extensions/array.rb
mongo_mapper-0.9.1 lib/mongo_mapper/extensions/array.rb
mongo_mapper-0.9.0 lib/mongo_mapper/extensions/array.rb
ign-mongo_mapper-0.8.6.2 lib/mongo_mapper/extensions/array.rb
ign-mongo_mapper-0.8.6.1 lib/mongo_mapper/extensions/array.rb
ssherman-mongo_mapper-0.8.6 lib/mongo_mapper/extensions/array.rb
mongo_mapper-0.8.6 lib/mongo_mapper/extensions/array.rb