aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/relations/aggregation.rb9
-rw-r--r--lib/arel/relations/join.rb9
-rw-r--r--lib/arel/relations/nil.rb7
-rw-r--r--lib/arel/relations/recursion.rb8
4 files changed, 15 insertions, 18 deletions
diff --git a/lib/arel/relations/aggregation.rb b/lib/arel/relations/aggregation.rb
index 4c4ef0dfed..d18ef014fa 100644
--- a/lib/arel/relations/aggregation.rb
+++ b/lib/arel/relations/aggregation.rb
@@ -19,13 +19,18 @@ module Arel
end
def ==(other)
- self.class == other.class and self.relation == other.relation
+ self.class == other.class and
+ self.relation == other.relation
end
end
class Relation
def externalize
- aggregation?? Aggregation.new(self) : self
+ @externalized ||= aggregation?? Aggregation.new(self) : self
+ end
+
+ def aggregation?
+ false
end
end
end \ No newline at end of file
diff --git a/lib/arel/relations/join.rb b/lib/arel/relations/join.rb
index 92bbbd5626..2dd3555bac 100644
--- a/lib/arel/relations/join.rb
+++ b/lib/arel/relations/join.rb
@@ -35,9 +35,8 @@ module Arel
relation2.externalize.attributes).collect { |a| a.bind(self) }
end
- # XXX
def selects
- (relation1.externalize.selects).collect { |s| s.bind(self) }
+ relation1.externalize.selects
end
# XXX
@@ -60,4 +59,10 @@ module Arel
true
end
end
+
+ class Relation
+ def join?
+ false
+ end
+ end
end \ No newline at end of file
diff --git a/lib/arel/relations/nil.rb b/lib/arel/relations/nil.rb
index e78ebe6088..714b11cc2a 100644
--- a/lib/arel/relations/nil.rb
+++ b/lib/arel/relations/nil.rb
@@ -1,16 +1,11 @@
module Arel
class Nil < Relation
- # XXX
- include Recursion::BaseCase
-
def table_sql(formatter = nil); '' end
def relation_for(attribute); nil end
def name; '' end
- def to_s; '' end
-
+
def ==(other)
self.class == other.class
end
end
-
end \ No newline at end of file
diff --git a/lib/arel/relations/recursion.rb b/lib/arel/relations/recursion.rb
index 7507613a12..1333d7ff57 100644
--- a/lib/arel/relations/recursion.rb
+++ b/lib/arel/relations/recursion.rb
@@ -13,14 +13,6 @@ module Arel
def relation_for(attribute)
self[attribute] && self
end
-
- def join?
- false
- end
-
- def aggregation?
- false
- end
end
end
end \ No newline at end of file