1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Quitoting the table name before querying.

This commit is contained in:
Aaron Patterson 2011-12-05 14:20:14 -08:00
parent 988061ddb8
commit 8aa7b8695d

View file

@ -24,7 +24,7 @@ module ActiveRecord
# table_exists?(:developers)
def table_exists?(table_name)
begin
select_value("SELECT 1 FROM #{table_name.to_s} where 1=0")
select_value("SELECT 1 FROM #{quote_table_name(table_name)} where 1=0")
true
rescue
false