diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency/join_part.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency/join_part.rb b/activerecord/lib/active_record/associations/join_dependency/join_part.rb index d536eaf613..7175dff5ac 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_part.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_part.rb @@ -50,15 +50,9 @@ module ActiveRecord parents end - def each + def each(&block) yield self - iter = lambda { |list| - list.each { |item| - yield item - iter.call item.children - } - } - iter.call children + children.each { |child| child.each(&block) } end def aliased_table |