aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra/primitives/attribute.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/algebra/primitives/attribute.rb')
-rw-r--r--lib/arel/algebra/primitives/attribute.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/arel/algebra/primitives/attribute.rb b/lib/arel/algebra/primitives/attribute.rb
index 943c5b030e..7a4411e248 100644
--- a/lib/arel/algebra/primitives/attribute.rb
+++ b/lib/arel/algebra/primitives/attribute.rb
@@ -17,6 +17,10 @@ module Arel
def aggregation?
false
end
+
+ def inspect
+ "<Attribute #{name}>"
+ end
module Transformations
def self.included(klass)
@@ -129,5 +133,18 @@ module Arel
end
end
include Expressions
+
+ module Orderings
+ def asc
+ Ascending.new(self)
+ end
+
+ def desc
+ Descending.new(self)
+ end
+
+ alias_method :to_ordering, :asc
+ end
+ include Orderings
end
end