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:
parent
988061ddb8
commit
8aa7b8695d
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue