diff options
author | Ernie Miller <ernie@metautonomo.us> | 2010-09-29 20:08:57 -0400 |
---|---|---|
committer | Ernie Miller <ernie@metautonomo.us> | 2010-09-29 20:08:57 -0400 |
commit | eef61ab909b614ce6f2d100cfb50044c063bc24a (patch) | |
tree | eaa50f239fab9b1b3ed88be89ba743b5724fb19a /lib/arel/attributes | |
parent | f5b76c220ed6583628a84fd899fbb24c39c997ee (diff) | |
download | rails-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.rb | 8 |
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 |