def coerced_attributes
      attrs = []

      if new_record?
        attributes.each do |k, v|
          attrs << k << coerce_for_persistence(v) if (self.class.attributes[k][:default] || nil) != v
        end
      else
        changed_attributes.each_key do |key|
          attrs << key << coerce_for_persistence(attributes[key])
        end
      end

      attrs
    end
def coerced_attributes
      attrs = []

      if new_record?
        attributes.each do |k, v|
          attrs << k << coerce_for_persistence(v) if (self.class.attributes[k][:default] || nil) != v
        end
      else
        changed_attributes.each_key do |key|
          attrs << key << coerce_for_persistence(attributes[key])
        end
      end

      attrs
    end
rubocop:enable Metrics/AbcSize, Metrics/PerceivedComplexity