From 1492e83e49f74b1d874585000bad5368d9f09218 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Sat, 7 Feb 2015 17:36:22 -0700 Subject: rm `Type#number?` This predicate is only used in `query_attribute`, and is relatively easy to remove without adding a bunch of is a checks. --- activerecord/lib/active_record/attribute_methods/query.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/attribute_methods/query.rb') diff --git a/activerecord/lib/active_record/attribute_methods/query.rb b/activerecord/lib/active_record/attribute_methods/query.rb index 83b858aae7..553122a5fc 100644 --- a/activerecord/lib/active_record/attribute_methods/query.rb +++ b/activerecord/lib/active_record/attribute_methods/query.rb @@ -15,7 +15,6 @@ module ActiveRecord when false, nil then false else column = self.class.columns_hash[attr_name] - type = self.class.type_for_attribute(attr_name) if column.nil? if Numeric === value || value !~ /[^0-9]/ !value.to_i.zero? @@ -23,7 +22,7 @@ module ActiveRecord return false if ActiveRecord::ConnectionAdapters::Column::FALSE_VALUES.include?(value) !value.blank? end - elsif type.number? + elsif value.respond_to?(:zero?) !value.zero? else !value.blank? -- cgit v1.2.3