def attribute_changed?(attr)
      attr = database_field_name(attr)
      return false unless changed_attributes.key?(attr)
      changed_attributes[attr] != attributes[attr]
    end
def attribute_changed?(attr)
      attr = database_field_name(attr)
      return false unless changed_attributes.key?(attr)
      changed_attributes[attr] != attributes[attr]
    end
Determine if a specific attribute has changed.

 @example Has the attribute changed?
   model.attribute_changed?("name")

 @param [ String ] attr The name of the attribute.

 @return [ true, false ] Whether the attribute has changed.

 @since 2.1.6