don't raise exception when the value in the database (in an existing record) is nil
| 19 | 20 | |
|---|---|---|
| 52 | 52 | protected |
| 53 | 53 | def remove_unchanged_template_values # :nodoc: |
| 54 | 54 | 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] | |
| 56 | 57 | end |
| 57 | 58 | end |
| 58 | 59 | end |
