aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/attributes
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-09-07 16:37:11 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-09-07 16:37:11 -0700
commit5ab502a755d0031d229278b6f14123c45623dd04 (patch)
tree3c2948cda53c1c33d69b8d81542ce2d407adc512 /lib/arel/attributes
parentcea486ac810a92ef4f96ef84e3a412fd7a4f6925 (diff)
downloadrails-5ab502a755d0031d229278b6f14123c45623dd04.tar.gz
rails-5ab502a755d0031d229278b6f14123c45623dd04.tar.bz2
rails-5ab502a755d0031d229278b6f14123c45623dd04.zip
adding "as" and to_sql to count nodes
Diffstat (limited to 'lib/arel/attributes')
-rw-r--r--lib/arel/attributes/attribute.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/arel/attributes/attribute.rb b/lib/arel/attributes/attribute.rb
index ff17d6136c..6087dc8e52 100644
--- a/lib/arel/attributes/attribute.rb
+++ b/lib/arel/attributes/attribute.rb
@@ -8,6 +8,10 @@ module Arel
def in other
Nodes::In.new self, other
end
+
+ def count
+ Nodes::Count.new [self]
+ end
end
class String < Attribute; end
@@ -17,4 +21,6 @@ module Arel
class Float < Attribute; end
class Integer < Attribute; end
end
+
+ Attribute = Attributes::Attribute
end