diff options
Diffstat (limited to 'lib/arel/algebra/relations/utilities/compound.rb')
-rw-r--r-- | lib/arel/algebra/relations/utilities/compound.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/arel/algebra/relations/utilities/compound.rb b/lib/arel/algebra/relations/utilities/compound.rb index 7039b82575..416717310c 100644 --- a/lib/arel/algebra/relations/utilities/compound.rb +++ b/lib/arel/algebra/relations/utilities/compound.rb @@ -13,7 +13,7 @@ module Arel @requires end - [:attributes, :wheres, :groupings, :orders, :havings, :projections].each do |operation_name| + [:wheres, :groupings, :orders, :havings, :projections].each do |operation_name| class_eval <<-OPERATION, __FILE__, __LINE__ def #{operation_name} @#{operation_name} ||= relation.#{operation_name}.collect { |o| o.bind(self) } @@ -21,6 +21,10 @@ module Arel OPERATION end + def attributes + @attributes ||= relation.attributes.bind(self) + end + def hash @hash ||= :relation.hash end |