aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/attributes
diff options
context:
space:
mode:
authorErnie Miller <ernie@metautonomo.us>2010-09-29 20:08:57 -0400
committerErnie Miller <ernie@metautonomo.us>2010-09-29 20:08:57 -0400
commiteef61ab909b614ce6f2d100cfb50044c063bc24a (patch)
treeeaa50f239fab9b1b3ed88be89ba743b5724fb19a /lib/arel/attributes
parentf5b76c220ed6583628a84fd899fbb24c39c997ee (diff)
downloadrails-eef61ab909b614ce6f2d100cfb50044c063bc24a.tar.gz
rails-eef61ab909b614ce6f2d100cfb50044c063bc24a.tar.bz2
rails-eef61ab909b614ce6f2d100cfb50044c063bc24a.zip
Support Attribute#asc and Attribute#desc to create orderings
Diffstat (limited to 'lib/arel/attributes')
-rw-r--r--lib/arel/attributes/attribute.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/arel/attributes/attribute.rb b/lib/arel/attributes/attribute.rb
index 25ffe717b2..ba18533590 100644
--- a/lib/arel/attributes/attribute.rb
+++ b/lib/arel/attributes/attribute.rb
@@ -151,6 +151,14 @@ module Arel
grouping_all :lteq, others
end
+ def asc
+ Nodes::Ordering.new self, :asc
+ end
+
+ def desc
+ Nodes::Ordering.new self, :desc
+ end
+
private
def grouping_any method_id, others