Module: Coercionlogic

Defined in:
lib/coercionlogic.rb

Instance Method Summary collapse

Instance Method Details

#write_attribute_with_coercion(attr_name, value) ⇒ Object



4
5
6
7
# File 'lib/coercionlogic.rb', line 4

def write_attribute_with_coercion(attr_name, value)
  value = nil if value.is_a?(String) && value.blank?
  write_attribute_without_coercion(attr_name, value)
end