aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_relation/primitives/attribute.rb
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-13 18:45:20 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-13 18:45:20 -0700
commit04c8e48311231d0b8332a7050a48defc9d7b075e (patch)
treeb2ffeda286cf212d3acf67c11b01e013f4c26424 /lib/active_relation/primitives/attribute.rb
parent4466409205d697f854f98ac0908a792a1601ecc6 (diff)
downloadrails-04c8e48311231d0b8332a7050a48defc9d7b075e.tar.gz
rails-04c8e48311231d0b8332a7050a48defc9d7b075e.tar.bz2
rails-04c8e48311231d0b8332a7050a48defc9d7b075e.zip
new conception of grouping and aggregation functionality
Diffstat (limited to 'lib/active_relation/primitives/attribute.rb')
-rw-r--r--lib/active_relation/primitives/attribute.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/active_relation/primitives/attribute.rb b/lib/active_relation/primitives/attribute.rb
index d37271490a..5b1ef4d7c0 100644
--- a/lib/active_relation/primitives/attribute.rb
+++ b/lib/active_relation/primitives/attribute.rb
@@ -10,6 +10,10 @@ module ActiveRelation
def alias_or_name
@alias || name
end
+
+ def aggregation?
+ false
+ end
module Transformations
def as(aliaz = nil)
@@ -56,10 +60,8 @@ module ActiveRelation
end
def %(other)
- if other
- (history - other.history) + (other.history - history)
- else
- history
+ if other then (history - other.history) + (other.history - history)
+ else history
end
end
end