Permalink
Browse files

Quote the column name to avoid issues with SQL reserved words

  • Loading branch information...
1 parent da76a47 commit 598f353af97d7ea8d2d28f5a988ec0cfeb64499e @jrafanie jrafanie committed with Nov 3, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/scrooge.rb
View
@@ -75,7 +75,7 @@ def callsite( signature )
# Link the column to its table
#
def attribute_with_table( attr_name )
- "#{quoted_table_name}.#{attr_name.to_s}"
+ "#{quoted_table_name}.#{connection.quote_column_name(attr_name.to_s)}"
end
# Computes a unique signature from a given call stack and supplementary
@@ -95,4 +95,4 @@ def callsite_signature( call_stack, supplementary )
end
Scrooge::Optimizations::Columns::Macro.install!
-Scrooge::Optimizations::Associations::Macro.install!
+Scrooge::Optimizations::Associations::Macro.install!

0 comments on commit 598f353

Please sign in to comment.