Module: MongoMapper::Plugins::Stripper::InstanceMethods

Defined in:
lib/mm-stripper.rb

Instance Method Summary collapse

Instance Method Details

#strip_attributesObject



13
14
15
16
17
18
19
20
21
# File 'lib/mm-stripper.rb', line 13

def strip_attributes
  attributes.each do |key, value|
    if value.is_a?(String)
      value = value.strip
      value = nil if value.blank?
      self[key] = value
    end
  end
end