1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-02 21:59:39 +00:00

acts_as_versioned not compatible with ActiveRecord 4.2.1 (#19957).

git-svn-id: http://svn.redmine.org/redmine/trunk@14294 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2015-05-31 07:19:33 +00:00
parent ed9f00178c
commit ea34967e65

View File

@ -447,7 +447,7 @@ module ActiveRecord #:nodoc:
def write_changed_attribute(attr_name, attr_value)
# Convert to db type for comparison. Avoids failing Float<=>String comparisons.
attr_value_for_db = self.class.columns_hash[attr_name.to_s].type_cast(attr_value)
attr_value_for_db = self.class.columns_hash[attr_name.to_s].type_cast_from_database(attr_value)
(self.altered_attributes ||= []) << attr_name.to_s unless self.changed?(attr_name) || self.send(attr_name) == attr_value_for_db
write_attribute(attr_name, attr_value_for_db)
end