aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/schema_dumper.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2016-02-12 07:26:05 +0900
committerRyuta Kamizono <kamipo@gmail.com>2016-03-11 14:43:20 +0900
commit270bcebdf79fd033e8451a2b6ab1c3db1dfb87b2 (patch)
tree2feb914887aa64094e8af50011dbd4d0ba95e95a /activerecord/lib/active_record/schema_dumper.rb
parenta101115d5b8011278891f30f69901f9583ea7685 (diff)
downloadrails-270bcebdf79fd033e8451a2b6ab1c3db1dfb87b2.tar.gz
rails-270bcebdf79fd033e8451a2b6ab1c3db1dfb87b2.tar.bz2
rails-270bcebdf79fd033e8451a2b6ab1c3db1dfb87b2.zip
Extract `default_primary_key?` to refactor `column_spec_for_primary_key`
Diffstat (limited to 'activerecord/lib/active_record/schema_dumper.rb')
-rw-r--r--activerecord/lib/active_record/schema_dumper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/schema_dumper.rb b/activerecord/lib/active_record/schema_dumper.rb
index f115c7542b..91be063a4f 100644
--- a/activerecord/lib/active_record/schema_dumper.rb
+++ b/activerecord/lib/active_record/schema_dumper.rb
@@ -126,7 +126,7 @@ HEADER
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
+ if pkcolspec.present?
pkcolspec.each do |key, value|
tbl.print ", #{key}: #{value}"
end