From 5e76aa7962c4e02c67c1e1515e6ae1b5ca6190a7 Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Fri, 12 Mar 2010 11:31:32 -0300 Subject: Add accessibility to projections applied to the relation. --- lib/arel/algebra/relations/relation.rb | 1 + lib/arel/algebra/relations/utilities/compound.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/arel/algebra/relations/relation.rb b/lib/arel/algebra/relations/relation.rb index 4cd3f8e109..51c622cbe8 100644 --- a/lib/arel/algebra/relations/relation.rb +++ b/lib/arel/algebra/relations/relation.rb @@ -128,6 +128,7 @@ module Arel module DefaultOperations def attributes; [] end + def projections; [] end def wheres; [] end def orders; [] end def inserts; [] end diff --git a/lib/arel/algebra/relations/utilities/compound.rb b/lib/arel/algebra/relations/utilities/compound.rb index 9eca02c8c4..1a43c76a94 100644 --- a/lib/arel/algebra/relations/utilities/compound.rb +++ b/lib/arel/algebra/relations/utilities/compound.rb @@ -5,7 +5,7 @@ module Arel :column_for, :engine, :sources, :locked, :table_alias, :to => :relation - [:attributes, :wheres, :groupings, :orders, :havings].each do |operation_name| + [:attributes, :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) } -- cgit v1.2.3