Skip to content

Commit ad41585

Browse files
committed
backport column_name_for_operation for postgres on 4.2
1 parent 1aa6b2e commit ad41585

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/arjdbc/postgresql/adapter.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,16 @@ def indexes(table_name, name = nil)
12621262
result
12631263
end
12641264

1265+
# @private
1266+
def column_name_for_operation(operation, node)
1267+
case operation
1268+
when 'maximum' then 'max'
1269+
when 'minimum' then 'min'
1270+
when 'average' then 'avg'
1271+
else operation.downcase
1272+
end
1273+
end if AR42_COMPAT
1274+
12651275
private
12661276

12671277
def translate_exception(exception, message)

0 commit comments

Comments
 (0)