Class: String

Inherits:
Object show all
Defined in:
lib/mongomapper/support.rb

Class Method Summary collapse

Class Method Details

.from_mongo(value) ⇒ Object



127
128
129
# File 'lib/mongomapper/support.rb', line 127

def self.from_mongo(value)
  value.present? ? value : nil
end

.to_mongo(value) ⇒ Object



123
124
125
# File 'lib/mongomapper/support.rb', line 123

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