Skip to content

Commit 598f353

Browse files
jrafaniemethodmissing
authored andcommitted
Quote the column name to avoid issues with SQL reserved words
1 parent da76a47 commit 598f353

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/scrooge.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def callsite( signature )
7575
# Link the column to its table
7676
#
7777
def attribute_with_table( attr_name )
78-
"#{quoted_table_name}.#{attr_name.to_s}"
78+
"#{quoted_table_name}.#{connection.quote_column_name(attr_name.to_s)}"
7979
end
8080

8181
# Computes a unique signature from a given call stack and supplementary
@@ -95,4 +95,4 @@ def callsite_signature( call_stack, supplementary )
9595
end
9696

9797
Scrooge::Optimizations::Columns::Macro.install!
98-
Scrooge::Optimizations::Associations::Macro.install!
98+
Scrooge::Optimizations::Associations::Macro.install!

0 commit comments

Comments
 (0)