提交 6a5388b6 编写于 作者: J Jamis Buck

try to appease the angry Oracle


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5808 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 0bfabaa0
...@@ -1979,7 +1979,7 @@ def query_attribute(attr_name) ...@@ -1979,7 +1979,7 @@ def query_attribute(attr_name)
else else
column = self.class.columns_hash[attr_name] column = self.class.columns_hash[attr_name]
if column.nil? if column.nil?
if value !~ /[^0-9]/ if Numeric === value || value !~ /[^0-9]/
!value.to_i.zero? !value.to_i.zero?
else else
!value.blank? !value.blank?
......
...@@ -314,7 +314,7 @@ def test_query_attribute_with_custom_fields ...@@ -314,7 +314,7 @@ def test_query_attribute_with_custom_fields
object.string_value = " " object.string_value = " "
assert !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? assert object.int_value?
object.int_value = "0" object.int_value = "0"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册