avatar

20

don't raise exception when the value in the database (in an existing record) is nil

by chrisk, 28 Jul, 2007 10:02 PM
19 20  
5252       protected
5353       def remove_unchanged_template_values  # :nodoc:
5454         templated_attributes_options.each_pair do |attr_name, options|
55           write_attribute(attr_name, nil) if read_attribute(attr_name).strip == options[:value]
55           value = read_attribute(attr_name)
56           write_attribute(attr_name, nil) if value.nil? || value.strip == options[:value]
5657         end
5758       end
5859     end