Module: Behi::Trimify::InstanceMethods
- Defined in:
- lib/trimify.rb
Instance Method Summary collapse
Instance Method Details
#trimify ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/trimify.rb', line 33 def trimify self.class.trimify_attributes.each do |attribute, | value = read_attribute(attribute) if value.is_a?(String) value.strip! value = nil if (value.blank? && [:nilify] == true) write_attribute(attribute, value) end end end |