diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-06-30 02:39:36 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-07-02 15:21:02 +0900 |
commit | cf09d5bd63a6c886d0417163de2e966669c52809 (patch) | |
tree | 3284be5e84bb7d9a02d43ae975aebf0dd9e8b3f8 /activerecord/lib/active_record/schema_dumper.rb | |
parent | 8fb699571486ad752741672e6fec1132026d3dfb (diff) | |
download | rails-cf09d5bd63a6c886d0417163de2e966669c52809.tar.gz rails-cf09d5bd63a6c886d0417163de2e966669c52809.tar.bz2 rails-cf09d5bd63a6c886d0417163de2e966669c52809.zip |
Move the warning about composite primary key to `AttributeMethods::PrimaryKey`
Actually schema dumper/creation supports composite primary key (#21614).
Therefore it should not show the warning about composite primary key in
connection adapter.
This change moves the warning to `AttributeMethods::PrimaryKey` and
suppress the warning for habtm join table.
Fixes #25388.
Diffstat (limited to 'activerecord/lib/active_record/schema_dumper.rb')
-rw-r--r-- | activerecord/lib/active_record/schema_dumper.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/schema_dumper.rb b/activerecord/lib/active_record/schema_dumper.rb index d769376d1a..e8c176d603 100644 --- a/activerecord/lib/active_record/schema_dumper.rb +++ b/activerecord/lib/active_record/schema_dumper.rb @@ -105,12 +105,7 @@ HEADER tbl = StringIO.new # first dump primary key column - if @connection.respond_to?(:primary_keys) - pk = @connection.primary_keys(table) - pk = pk.first unless pk.size > 1 - else - pk = @connection.primary_key(table) - end + pk = @connection.primary_key(table) tbl.print " create_table #{remove_prefix_and_suffix(table).inspect}" |