Skip to content
Browse files

do not cache sql literal values

  • Loading branch information...
1 parent 0eeb2da commit bc0510c0027c28a2b45c8c51f75edaf40d6f4536 @tenderlove tenderlove committed
Showing with 3 additions and 2 deletions.
  1. +2 −1 lib/arel/visitors/to_sql.rb
  2. +1 −1 test/test_select_manager.rb
View
3 lib/arel/visitors/to_sql.rb
@@ -416,7 +416,8 @@ def quote value, column = nil
end
def quote_table_name name
- @quoted_tables[name] ||= Arel::Nodes::SqlLiteral === name ? name : @connection.quote_table_name(name)
+ return name if Arel::Nodes::SqlLiteral === name
+ @quoted_tables[name] ||= @connection.quote_table_name(name)
end
def quote_column_name name
View
2 test/test_select_manager.rb
@@ -216,7 +216,7 @@ def test_join_sources
table = Table.new :users, :engine => Table.engine, :as => 'foo'
mgr = table.from table
mgr.skip 10
- mgr.to_sql.must_be_like %{ SELECT FROM "users" foo OFFSET 10 }
+ mgr.to_sql.must_be_like %{ SELECT FROM "users" "foo" OFFSET 10 }
end
end

0 comments on commit bc0510c

Please sign in to comment.
Something went wrong with that request. Please try again.