diff options
author | Jamis Buck <jamis@37signals.com> | 2006-12-29 19:05:53 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2006-12-29 19:05:53 +0000 |
commit | 6a5388b6549cb88fd19ff7ea2c48be1210a6e1cb (patch) | |
tree | 7370318a247c7afd137fe3dd6248729b554e2555 /activerecord | |
parent | 0bfabaa048bdc70eae0cce399809ebd2bb129ffe (diff) | |
download | rails-6a5388b6549cb88fd19ff7ea2c48be1210a6e1cb.tar.gz rails-6a5388b6549cb88fd19ff7ea2c48be1210a6e1cb.tar.bz2 rails-6a5388b6549cb88fd19ff7ea2c48be1210a6e1cb.zip |
try to appease the angry Oracle
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5808 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 2 | ||||
-rwxr-xr-x | activerecord/test/base_test.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 26010d8643..a4c317ff3f 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1979,7 +1979,7 @@ module ActiveRecord #:nodoc: else column = self.class.columns_hash[attr_name] if column.nil? - if value !~ /[^0-9]/ + if Numeric === value || value !~ /[^0-9]/ !value.to_i.zero? else !value.blank? diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index d6b912eb6a..ab73ea77a7 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -314,7 +314,7 @@ class BasicsTest < Test::Unit::TestCase object.string_value = " " assert !object.string_value? - assert_equal "1", object.int_value + assert_equal 1, object.int_value.to_i assert object.int_value? object.int_value = "0" |