Module: MongoMapper::Extensions::String

Included in:
String
Defined in:
lib/mongo_mapper/extensions/string.rb

Instance Method Summary collapse

Instance Method Details

#from_mongo(value) ⇒ Object



9
10
11
# File 'lib/mongo_mapper/extensions/string.rb', line 9

def from_mongo(value)
  value.nil? ? nil : value.to_s
end

#to_mongo(value) ⇒ Object



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

def to_mongo(value)
  value.nil? ? nil : value.to_s
end