From 4df2b779ddfcb27761c71e00e2b241bfa06a0950 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 6 Aug 2016 18:24:04 +0200 Subject: applies new string literal convention in activerecord/lib The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default. --- activerecord/lib/active_record/schema_dumper.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'activerecord/lib/active_record/schema_dumper.rb') diff --git a/activerecord/lib/active_record/schema_dumper.rb b/activerecord/lib/active_record/schema_dumper.rb index cc3bb1cd06..5105088b2f 100644 --- a/activerecord/lib/active_record/schema_dumper.rb +++ b/activerecord/lib/active_record/schema_dumper.rb @@ -1,4 +1,4 @@ -require 'stringio' +require "stringio" module ActiveRecord # = Active Record Schema Dumper @@ -111,7 +111,7 @@ HEADER case pk when String - tbl.print ", primary_key: #{pk.inspect}" unless pk == 'id' + tbl.print ", primary_key: #{pk.inspect}" unless pk == "id" pkcol = columns.detect { |c| c.name == pk } pkcolspec = @connection.column_spec_for_primary_key(pkcol) if pkcolspec.present? @@ -161,12 +161,12 @@ HEADER # add column type definition to our format string format_string.unshift " t.%-#{type_length}s " - format_string *= '' + format_string *= "" column_specs.each do |colspec| values = keys.zip(lengths).map{ |key, len| colspec.key?(key) ? colspec[key] + ", " : " " * len } values.unshift colspec[:type] - tbl.print((format_string % values).gsub(/,\s*$/, '')) + tbl.print((format_string % values).gsub(/,\s*$/, "")) tbl.puts end @@ -213,7 +213,7 @@ HEADER index.columns.inspect, "name: #{index.name.inspect}", ] - index_parts << 'unique: true' if index.unique + index_parts << "unique: true" if index.unique index_lengths = (index.lengths || []).compact index_parts << "length: #{Hash[index.columns.zip(index.lengths)].inspect}" if index_lengths.any? -- cgit v1.2.3