aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-07-03 09:51:24 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-07-03 09:51:24 +0000
commitaaa56372494d3c9953e9ef2bdfc0fefd2f75fcad (patch)
tree8c7dfc2d83ea241bf70e02a8d61790f8e8434dac /activerecord/lib/active_record
parente24e2c41c20cc93f3b4efd84ebdf212626bbc926 (diff)
downloadrails-aaa56372494d3c9953e9ef2bdfc0fefd2f75fcad.tar.gz
rails-aaa56372494d3c9953e9ef2bdfc0fefd2f75fcad.tar.bz2
rails-aaa56372494d3c9953e9ef2bdfc0fefd2f75fcad.zip
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
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
1 files changed, 1 insertions, 1 deletions
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 <tt>attr_name</tt> 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)