aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/nodes/and.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/nodes/and.rb')
-rw-r--r--lib/arel/nodes/and.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/arel/nodes/and.rb b/lib/arel/nodes/and.rb
index 80f420b4f1..b087a10930 100644
--- a/lib/arel/nodes/and.rb
+++ b/lib/arel/nodes/and.rb
@@ -1,6 +1,23 @@
module Arel
module Nodes
class And < Arel::Nodes::Binary
+ attr_reader :children
+
+ def initialize children, right = nil
+ unless Array === children
+ warn "(#{caller.first}) AND nodes should be created with a list"
+ children = [children, right]
+ end
+ @children = children
+ end
+
+ def left
+ children.first
+ end
+
+ def right
+ children[1]
+ end
end
end
end