diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-06-01 10:32:11 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-06-01 10:36:14 +0900 |
commit | 3c3ff9c76a2ddef5bf52c25cd75cb4f909dc58bd (patch) | |
tree | ceb062081e7bf5f9ebe5e59ee6ca8dea2841c7df | |
parent | 908b136cf27aeb38b06dc98e7d2215d852ffc962 (diff) | |
download | rails-3c3ff9c76a2ddef5bf52c25cd75cb4f909dc58bd.tar.gz rails-3c3ff9c76a2ddef5bf52c25cd75cb4f909dc58bd.tar.bz2 rails-3c3ff9c76a2ddef5bf52c25cd75cb4f909dc58bd.zip |
Should use `quote` for a string literal
Follow up of #29077.
Before:
```sql
SELECT sql FROM sqlite_master WHERE tbl_name NOT IN ("foo") ORDER BY tbl_name, type DESC, name
```
After:
```sql
SELECT sql FROM sqlite_master WHERE tbl_name NOT IN ('foo') ORDER BY tbl_name, type DESC, name
```
> If a keyword in double quotes (ex: "key" or "glob") is used in a
context where it cannot be resolved to an identifier but where a string
literal is allowed, then the token is understood to be a string literal
instead of an identifier.
http://www.sqlite.org/lang_keywords.html
-rw-r--r-- | activerecord/lib/active_record/tasks/sqlite_database_tasks.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/tasks/sqlite_database_tasks.rb b/activerecord/lib/active_record/tasks/sqlite_database_tasks.rb index 7043d2f0c8..01562b21e9 100644 --- a/activerecord/lib/active_record/tasks/sqlite_database_tasks.rb +++ b/activerecord/lib/active_record/tasks/sqlite_database_tasks.rb @@ -42,7 +42,7 @@ module ActiveRecord ignore_tables = ActiveRecord::SchemaDumper.ignore_tables if ignore_tables.any? - condition = ignore_tables.map { |table| connection.quote_table_name(table) }.join(", ") + condition = ignore_tables.map { |table| connection.quote(table) }.join(", ") args << "SELECT sql FROM sqlite_master WHERE tbl_name NOT IN (#{condition}) ORDER BY tbl_name, type DESC, name" else args << ".schema" |