From 66cedcc76bf8ac97a65bf12f6b7dd2eea83ebfe3 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 26 Jul 2010 14:55:59 -0700 Subject: reorganizing classes more --- lib/arel/algebra/relations/utilities/externalization.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/arel/algebra') diff --git a/lib/arel/algebra/relations/utilities/externalization.rb b/lib/arel/algebra/relations/utilities/externalization.rb index 815e1e0aa7..8e97573f68 100644 --- a/lib/arel/algebra/relations/utilities/externalization.rb +++ b/lib/arel/algebra/relations/utilities/externalization.rb @@ -1,5 +1,7 @@ module Arel class Externalization < Compound + include Recursion::BaseCase + def == other super || Externalization === other && relation == other.relation end @@ -11,5 +13,14 @@ module Arel def attributes @attributes ||= Header.new(relation.attributes.map { |a| a.to_attribute(self) }) end + + def table_sql(formatter = Sql::TableReference.new(relation)) + formatter.select relation.compiler.select_sql, self + end + + # REMOVEME + def name + relation.name + '_external' + end end end -- cgit v1.2.3