aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/query_attribute.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-01-03 09:46:42 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-01-08 16:45:17 +0900
commit7f856c3c8db71e2600d6a84bbc6510eb4ddd0418 (patch)
tree0a88d5d29152838ecc9495e784f5b6e68aa2b725 /activerecord/lib/active_record/relation/query_attribute.rb
parenta75dea08225285eec5fc199684cd1a51853d2845 (diff)
downloadrails-7f856c3c8db71e2600d6a84bbc6510eb4ddd0418.tar.gz
rails-7f856c3c8db71e2600d6a84bbc6510eb4ddd0418.tar.bz2
rails-7f856c3c8db71e2600d6a84bbc6510eb4ddd0418.zip
Consolidate the duplicated code that building range predicate
This slightly change the code in the Arel to allow +/-INFINITY as open ended since the Active Record expects that behavior. See 5ecbeda.
Diffstat (limited to 'activerecord/lib/active_record/relation/query_attribute.rb')
-rw-r--r--activerecord/lib/active_record/relation/query_attribute.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/relation/query_attribute.rb b/activerecord/lib/active_record/relation/query_attribute.rb
index f64bd30d38..b45326bdda 100644
--- a/activerecord/lib/active_record/relation/query_attribute.rb
+++ b/activerecord/lib/active_record/relation/query_attribute.rb
@@ -30,12 +30,12 @@ module ActiveRecord
@_boundable = false
end
- def infinity?
- _infinity?(value_before_type_cast) || boundable? && _infinity?(value_for_database)
+ def infinite?
+ infinity?(value_before_type_cast) || boundable? && infinity?(value_for_database)
end
private
- def _infinity?(value)
+ def infinity?(value)
value.respond_to?(:infinite?) && value.infinite?
end
end