From 53bfaedaca5387bbc27a4ce04ea47367aaf4401a Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 30 Jul 2010 11:00:09 -0700 Subject: PERF caching engine, converting to an attr_reader --- lib/arel/algebra/relations/utilities/compound.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/arel') diff --git a/lib/arel/algebra/relations/utilities/compound.rb b/lib/arel/algebra/relations/utilities/compound.rb index 25f634ef78..80ac0b1351 100644 --- a/lib/arel/algebra/relations/utilities/compound.rb +++ b/lib/arel/algebra/relations/utilities/compound.rb @@ -2,13 +2,14 @@ module Arel class Compound include Relation - attr_reader :relation + attr_reader :relation, :engine delegate :joins, :join?, :inserts, :taken, :skipped, :name, :externalizable?, :column_for, :sources, :locked, :table_alias, :array, :to => :relation def initialize relation @relation = relation + @engine = relation.engine @attributes = nil @wheres = nil @groupings = nil @@ -32,9 +33,5 @@ module Arel def unoperated_rows relation.call.collect { |row| row.bind(self) } end - - def engine - relation.engine - end end end -- cgit v1.2.3