From aaa56372494d3c9953e9ef2bdfc0fefd2f75fcad Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 3 Jul 2005 09:51:24 +0000 Subject: Fixed Base#write_attribute to work with both symbols and strings #1190 [Paul Legato] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1643 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 697e7a0c41..183aae280f 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1241,7 +1241,7 @@ module ActiveRecord #:nodoc: # Updates the attribute identified by attr_name with the specified +value+. Empty strings for fixnum and float # columns are turned into nil. def write_attribute(attr_name, value) - @attributes[attr_name] = empty_string_for_number_column?(attr_name, value) ? nil : value + @attributes[attr_name.to_s] = empty_string_for_number_column?(attr_name.to_s, value) ? nil : value end def empty_string_for_number_column?(attr_name, value) -- cgit v1.2.3