aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/attributes/attribute.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/arel/attributes/attribute.rb b/lib/arel/attributes/attribute.rb
index e1f7fd81d2..b5698a3f1d 100644
--- a/lib/arel/attributes/attribute.rb
+++ b/lib/arel/attributes/attribute.rb
@@ -11,6 +11,14 @@ module Arel
Nodes::Equality.new self, other
end
+ def eq_any others
+ first = Nodes::Equality.new self, others.shift
+
+ Nodes::Grouping.new others.inject(first) { |memo,expr|
+ Nodes::Or.new(memo, Nodes::Equality.new(self, expr))
+ }
+ end
+
def in other
case other
when Arel::SelectManager