Module: MongoMapper::Extensions::Array

Included in:
Array
Defined in:
lib/mongo_mapper/extensions/array.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) from_mongo(value)



10
11
12
# File 'lib/mongo_mapper/extensions/array.rb', line 10

def from_mongo(value)
  value || []
end

- (Object) to_mongo(value)



5
6
7
8
# File 'lib/mongo_mapper/extensions/array.rb', line 5

def to_mongo(value)
  value = value.respond_to?(:lines) ? value.lines : value
  value.to_a
end