aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/nodes/node.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/nodes/node.rb')
-rw-r--r--lib/arel/nodes/node.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/arel/nodes/node.rb b/lib/arel/nodes/node.rb
index 90c63f0be9..634e580a8f 100644
--- a/lib/arel/nodes/node.rb
+++ b/lib/arel/nodes/node.rb
@@ -37,6 +37,8 @@ module Arel
# Iterate through AST, nodes will be yielded depth-first
def each &block
+ return enum_for(:each) unless block_given?
+
Visitors::DepthFirst.new(block).accept self
end
end