aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/relations/utilities
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-05-19 19:38:36 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-05-19 19:38:36 -0700
commit2d021c641ab8c9215df863531cfb0d8ff8b9554a (patch)
treeda95d1423997ade3b000b0c210c44c2936c87f57 /lib/arel/relations/utilities
parent9e5ee49ec55b9cb1c2b4444dee58f3dfaefc7c7e (diff)
downloadrails-2d021c641ab8c9215df863531cfb0d8ff8b9554a.tar.gz
rails-2d021c641ab8c9215df863531cfb0d8ff8b9554a.tar.bz2
rails-2d021c641ab8c9215df863531cfb0d8ff8b9554a.zip
removed more boiler-plate
Diffstat (limited to 'lib/arel/relations/utilities')
-rw-r--r--lib/arel/relations/utilities/aggregation.rb11
-rw-r--r--lib/arel/relations/utilities/nil.rb6
2 files changed, 4 insertions, 13 deletions
diff --git a/lib/arel/relations/utilities/aggregation.rb b/lib/arel/relations/utilities/aggregation.rb
index 66150bff0a..9f5ead8f86 100644
--- a/lib/arel/relations/utilities/aggregation.rb
+++ b/lib/arel/relations/utilities/aggregation.rb
@@ -1,11 +1,9 @@
module Arel
class Aggregation < Compound
+ attributes :relation
+ deriving :initialize, :==
include Recursion::BaseCase
- def initialize(relation)
- @relation = relation
- end
-
def wheres
[]
end
@@ -21,11 +19,6 @@ module Arel
def name
relation.name + '_aggregation'
end
-
- def ==(other)
- Aggregation === other and
- self.relation == other.relation
- end
end
class Relation
diff --git a/lib/arel/relations/utilities/nil.rb b/lib/arel/relations/utilities/nil.rb
index 2dcfb47233..2b8dc570f8 100644
--- a/lib/arel/relations/utilities/nil.rb
+++ b/lib/arel/relations/utilities/nil.rb
@@ -1,10 +1,8 @@
module Arel
class Nil < Relation
+ include Singleton
+
def table_sql(formatter = nil); '' end
def name; '' end
-
- def ==(other)
- Nil === other
- end
end
end \ No newline at end of file