]> source.dussan.org Git - redmine.git/commitdiff
Merged r14294 (#19957).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 13 Jun 2015 11:10:22 +0000 (11:10 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 13 Jun 2015 11:10:22 +0000 (11:10 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.0-stable@14306 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb

index 618cf07c535417edc98a1ccd471e08d56e1230db..adb9fed86f1fb92e11a9d67081a859bd67cb4940 100644 (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