From 0bfabaa048bdc70eae0cce399809ebd2bb129ffe Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Fri, 29 Dec 2006 17:24:35 +0000 Subject: make sure query attributes on custom fields works as it used to git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5807 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/base.rb | 8 +++++++- 1 file changed, 7 insertions(+), 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 f5e6fb57e3..26010d8643 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1978,7 +1978,13 @@ module ActiveRecord #:nodoc: false else column = self.class.columns_hash[attr_name] - if column.number? + if column.nil? + if value !~ /[^0-9]/ + !value.to_i.zero? + else + !value.blank? + end + elsif column.number? !value.zero? else !value.blank? -- cgit v1.2.3