Skip to content
Browse files

Add accessibility to projections applied to the relation.

  • Loading branch information...
1 parent 939b31d commit 5e76aa7962c4e02c67c1e1515e6ae1b5ca6190a7 @miloops miloops committed
Showing with 2 additions and 1 deletion.
  1. +1 −0 lib/arel/algebra/relations/relation.rb
  2. +1 −1 lib/arel/algebra/relations/utilities/compound.rb
View
1 lib/arel/algebra/relations/relation.rb
@@ -128,6 +128,7 @@ def has_attribute?(attribute)
module DefaultOperations
def attributes; [] end
+ def projections; [] end
def wheres; [] end
def orders; [] end
def inserts; [] end
View
2 lib/arel/algebra/relations/utilities/compound.rb
@@ -5,7 +5,7 @@ class Compound < Relation
: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) }

0 comments on commit 5e76aa7

Please sign in to comment.
Something went wrong with that request. Please try again.