diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-16 13:06:23 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-16 13:06:23 -0700 |
commit | 0ff5607e1e6e150915543766ac42a292a69fcfd6 (patch) | |
tree | 4d4205b74de49e2405e0ad96b4f004a546947a0a /lib/arel | |
parent | 6a0097468213e928f477f638ec53e9efa396febe (diff) | |
download | rails-0ff5607e1e6e150915543766ac42a292a69fcfd6.tar.gz rails-0ff5607e1e6e150915543766ac42a292a69fcfd6.tar.bz2 rails-0ff5607e1e6e150915543766ac42a292a69fcfd6.zip |
cleaned up nil
Diffstat (limited to 'lib/arel')
-rw-r--r-- | lib/arel/relations/aggregation.rb | 9 | ||||
-rw-r--r-- | lib/arel/relations/join.rb | 9 | ||||
-rw-r--r-- | lib/arel/relations/nil.rb | 7 | ||||
-rw-r--r-- | lib/arel/relations/recursion.rb | 8 |
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 |