From bf25ab9523e628c83ca4bd26a4b4d1d1ca84f723 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Mon, 8 Feb 2016 04:19:34 +0900 Subject: `schema_type` returns symbol rather than string A return value of `schema_type` is used by: 1. primary key type: using as `symbol.inspect` 2. normal column type: using as `symbol.to_s` It is better to return symbol. --- .../active_record/connection_adapters/postgresql/schema_dumper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activerecord/lib/active_record/connection_adapters/postgresql') diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_dumper.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_dumper.rb index cc7721ddd8..b82bdb8b0c 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_dumper.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_dumper.rb @@ -11,7 +11,7 @@ module ActiveRecord spec[:id] = ':uuid' spec[:default] = schema_default(column) || 'nil' else - spec[:id] = column.type.inspect + spec[:id] = schema_type(column).inspect spec.merge!(prepare_column_options(column).delete_if { |key, _| [:name, :type, :null].include?(key) }) end spec @@ -35,9 +35,9 @@ module ActiveRecord return super unless column.serial? if column.bigint? - 'bigserial' + :bigserial else - 'serial' + :serial end end -- cgit v1.2.3