diff options
author | Pat Allan <pat@freelancing-gods.com> | 2017-06-20 19:43:21 +1000 |
---|---|---|
committer | Pat Allan <pat@freelancing-gods.com> | 2017-06-20 19:43:21 +1000 |
commit | b86e313df53ada181850a057e254052f38014738 (patch) | |
tree | 41531a72563ec51568ca703aa0284acb689a75e0 /activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb | |
parent | 4ff30d9bb6d5d591fbb3952112d721c995059302 (diff) | |
download | rails-b86e313df53ada181850a057e254052f38014738.tar.gz rails-b86e313df53ada181850a057e254052f38014738.tar.bz2 rails-b86e313df53ada181850a057e254052f38014738.zip |
Make ActiveRecord frozen string literal friendly.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb index cb45d7ba6b..0a614e133d 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb @@ -408,7 +408,7 @@ module ActiveRecord quoted_table_name = quote_table_name(table_name) quoted_column_name = quote_column_name(column_name) sql_type = type_to_sql(type, options) - sql = "ALTER TABLE #{quoted_table_name} ALTER COLUMN #{quoted_column_name} TYPE #{sql_type}" + sql = "ALTER TABLE #{quoted_table_name} ALTER COLUMN #{quoted_column_name} TYPE #{sql_type}".dup if options[:collation] sql << " COLLATE \"#{options[:collation]}\"" end @@ -568,7 +568,7 @@ module ActiveRecord super end - sql << "[]" if array && type != :primary_key + sql = "#{sql}[]" if array && type != :primary_key sql end @@ -637,7 +637,7 @@ module ActiveRecord scope = quoted_scope(name, type: type) scope[:type] ||= "'r','v','m'" # (r)elation/table, (v)iew, (m)aterialized view - sql = "SELECT c.relname FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace" + sql = "SELECT c.relname FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace".dup sql << " WHERE n.nspname = #{scope[:schema]}" sql << " AND c.relname = #{scope[:name]}" if scope[:name] sql << " AND c.relkind IN (#{scope[:type]})" |