aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/arel/nodes/ascending.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/arel/nodes/ascending.rb')
-rw-r--r--activerecord/lib/arel/nodes/ascending.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/activerecord/lib/arel/nodes/ascending.rb b/activerecord/lib/arel/nodes/ascending.rb
new file mode 100644
index 0000000000..8b617f4df5
--- /dev/null
+++ b/activerecord/lib/arel/nodes/ascending.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module Arel # :nodoc: all
+ module Nodes
+ class Ascending < Ordering
+ def reverse
+ Descending.new(expr)
+ end
+
+ def direction
+ :asc
+ end
+
+ def ascending?
+ true
+ end
+
+ def descending?
+ false
+ end
+ end
+ end
+end