aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-07-26 14:55:59 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-26 14:55:59 -0700
commit66cedcc76bf8ac97a65bf12f6b7dd2eea83ebfe3 (patch)
tree23dd908d5476990efbc42fdb81c9deb593574fca /lib/arel/algebra
parent82e0b8dd85a82fc9907f96bb1af849453a87b01a (diff)
downloadrails-66cedcc76bf8ac97a65bf12f6b7dd2eea83ebfe3.tar.gz
rails-66cedcc76bf8ac97a65bf12f6b7dd2eea83ebfe3.tar.bz2
rails-66cedcc76bf8ac97a65bf12f6b7dd2eea83ebfe3.zip
reorganizing classes more
Diffstat (limited to 'lib/arel/algebra')
-rw-r--r--lib/arel/algebra/relations/utilities/externalization.rb11
1 files changed, 11 insertions, 0 deletions
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