aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel')
-rw-r--r--lib/arel/relations.rb1
-rw-r--r--lib/arel/relations/alias.rb15
-rw-r--r--lib/arel/relations/table.rb14
3 files changed, 5 insertions, 25 deletions
diff --git a/lib/arel/relations.rb b/lib/arel/relations.rb
index 96aa8e9d35..6cd599ad5d 100644
--- a/lib/arel/relations.rb
+++ b/lib/arel/relations.rb
@@ -1,3 +1,4 @@
+require 'arel/relations/recursion'
require 'arel/relations/relation'
require 'arel/relations/nil'
require 'arel/relations/compound'
diff --git a/lib/arel/relations/alias.rb b/lib/arel/relations/alias.rb
index 0099a794b4..08be02e862 100644
--- a/lib/arel/relations/alias.rb
+++ b/lib/arel/relations/alias.rb
@@ -1,5 +1,7 @@
module Arel
class Alias < Compound
+ include Recursion::BaseCase
+
def initialize(relation)
@relation = relation
end
@@ -7,18 +9,5 @@ module Arel
def ==(other)
equal? other
end
-
- def table
- self
- end
-
- def relation_for(attribute)
- self[attribute] and self
- end
-
- def table_sql(formatter = Sql::TableReference.new(self))
- formatter.table self
- end
-
end
end \ No newline at end of file
diff --git a/lib/arel/relations/table.rb b/lib/arel/relations/table.rb
index 75593731e0..735159508e 100644
--- a/lib/arel/relations/table.rb
+++ b/lib/arel/relations/table.rb
@@ -1,5 +1,7 @@
module Arel
class Table < Relation
+ include Recursion::BaseCase
+
cattr_accessor :engine
attr_reader :name, :engine
@@ -19,18 +21,6 @@ module Arel
self[attribute] and columns.detect { |c| c.name == attribute.name.to_s }
end
- def table
- self
- end
-
- def relation_for(attribute)
- self[attribute] and self
- end
-
- def table_sql(formatter = Sql::TableReference.new(self))
- formatter.table self
- end
-
def ==(other)
self.class == other.class and
name == other.name