Skip to content

Commit 283e898

Browse files
author
Eliezer Reis
committed
feat(support_attributes.rb): add fully_qualified_order_by method to have
an unambiguous order by expression
1 parent 1b07d5b commit 283e898

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/closure_tree/support_attributes.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ def quoted_order_column(include_table_name = true)
115115
"#{prefix}#{connection.quote_column_name(order_column)}"
116116
end
117117

118+
def fully_qualified_order_by
119+
"#{quoted_order_column} #{order_by_order}"
120+
end
121+
118122
# table_name alias keyword , like "AS". When used on table name alias, Oracle Database don't support used 'AS'
119123
def t_alias_keyword
120124
(ActiveRecord::Base.connection.adapter_name.to_sym == :OracleEnhanced) ? "" : "AS"

0 commit comments

Comments
 (0)