aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods/query.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-02-07 17:36:22 -0700
committerSean Griffin <sean@thoughtbot.com>2015-02-07 17:36:22 -0700
commit1492e83e49f74b1d874585000bad5368d9f09218 (patch)
treed51bf5354264b3b8843101ee331451f14f231505 /activerecord/lib/active_record/attribute_methods/query.rb
parent16629c099ca30895c90661d5cbce40e218f0984e (diff)
downloadrails-1492e83e49f74b1d874585000bad5368d9f09218.tar.gz
rails-1492e83e49f74b1d874585000bad5368d9f09218.tar.bz2
rails-1492e83e49f74b1d874585000bad5368d9f09218.zip
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.
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods/query.rb')
-rw-r--r--activerecord/lib/active_record/attribute_methods/query.rb3
1 files changed, 1 insertions, 2 deletions
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?