Module: MongoMapper::Extensions::Set

Included in:
Set
Defined in:
lib/mongo_mapper/extensions/set.rb

Instance Method Summary collapse

Instance Method Details

#from_mongo(value) ⇒ Object



11
12
13
# File 'lib/mongo_mapper/extensions/set.rb', line 11

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

#to_mongo(value) ⇒ Object



7
8
9
# File 'lib/mongo_mapper/extensions/set.rb', line 7

def to_mongo(value)
  value.to_a
end