aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/arel/nodes
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-01-14 13:22:54 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-01-18 14:56:43 +0900
commit5b6daff5b6d5439e07c058718069f54b34970f93 (patch)
tree2056e890057bb59eeef8356eb41741037aadcfaa /activerecord/lib/arel/nodes
parenteb63faaa1af7ef28ae1a716d068acc447e28c174 (diff)
downloadrails-5b6daff5b6d5439e07c058718069f54b34970f93.tar.gz
rails-5b6daff5b6d5439e07c058718069f54b34970f93.tar.bz2
rails-5b6daff5b6d5439e07c058718069f54b34970f93.zip
Use `unboundable?` rather than `boundable?`
The `unboundable?` behaves like the `infinite?`. ```ruby inf = Topic.predicate_builder.build_bind_attribute(:id, Float::INFINITY) inf.infinite? # => 1 oob = Topic.predicate_builder.build_bind_attribute(:id, 9999999999999999999999999999999) oob.unboundable? # => 1 inf = Topic.predicate_builder.build_bind_attribute(:id, -Float::INFINITY) inf.infinite? # => -1 oob = Topic.predicate_builder.build_bind_attribute(:id, -9999999999999999999999999999999) oob.unboundable? # => -1 ```
Diffstat (limited to 'activerecord/lib/arel/nodes')
-rw-r--r--activerecord/lib/arel/nodes/bind_param.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/arel/nodes/bind_param.rb b/activerecord/lib/arel/nodes/bind_param.rb
index f145e44ae3..344e46479f 100644
--- a/activerecord/lib/arel/nodes/bind_param.rb
+++ b/activerecord/lib/arel/nodes/bind_param.rb
@@ -28,8 +28,8 @@ module Arel # :nodoc: all
value.respond_to?(:infinite?) && value.infinite?
end
- def boundable?
- !value.respond_to?(:boundable?) || value.boundable?
+ def unboundable?
+ value.respond_to?(:unboundable?) && value.unboundable?
end
end
end