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