aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/schema_dumper.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-07-28 10:33:41 -0300
committerGitHub <noreply@github.com>2016-07-28 10:33:41 -0300
commitbe85efe8db42edb50a4f90e9f39f069bb5479b8e (patch)
tree0fc67f8da7550ec167305160c8766bce192ad7bf /activerecord/lib/active_record/schema_dumper.rb
parentb3348819c5d6acf13b97cb6c4825f0b1a004f7e9 (diff)
parenta31e837431ee131fbc6900f1b3c3d6ef09753f7a (diff)
downloadrails-be85efe8db42edb50a4f90e9f39f069bb5479b8e.tar.gz
rails-be85efe8db42edb50a4f90e9f39f069bb5479b8e.tar.bz2
rails-be85efe8db42edb50a4f90e9f39f069bb5479b8e.zip
Merge pull request #25340 from kamipo/prevent_table_comment_query
Prevent `table_comment` query if a table doesn't have a comment
Diffstat (limited to 'activerecord/lib/active_record/schema_dumper.rb')
-rw-r--r--activerecord/lib/active_record/schema_dumper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/schema_dumper.rb b/activerecord/lib/active_record/schema_dumper.rb
index e8c176d603..cc3bb1cd06 100644
--- a/activerecord/lib/active_record/schema_dumper.rb
+++ b/activerecord/lib/active_record/schema_dumper.rb
@@ -127,10 +127,10 @@ HEADER
tbl.print ", force: :cascade"
table_options = @connection.table_options(table)
- tbl.print ", options: #{table_options.inspect}" unless table_options.blank?
-
- if comment = @connection.table_comment(table).presence
- tbl.print ", comment: #{comment.inspect}"
+ if table_options.present?
+ table_options.each do |key, value|
+ tbl.print ", #{key}: #{value.inspect}" if value.present?
+ end
end
tbl.puts " do |t|"