aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/schema_dumper.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2016-06-10 07:57:22 +0900
committerRyuta Kamizono <kamipo@gmail.com>2016-06-10 07:57:22 +0900
commita31e837431ee131fbc6900f1b3c3d6ef09753f7a (patch)
tree6ba1db0e9e255627c541053afdf1f50c2a9e9862 /activerecord/lib/active_record/schema_dumper.rb
parentf9a39e0d51400c62348e6e299d4c53e9eababef2 (diff)
downloadrails-a31e837431ee131fbc6900f1b3c3d6ef09753f7a.tar.gz
rails-a31e837431ee131fbc6900f1b3c3d6ef09753f7a.tar.bz2
rails-a31e837431ee131fbc6900f1b3c3d6ef09753f7a.zip
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 d769376d1a..1813bcd26a 100644
--- a/activerecord/lib/active_record/schema_dumper.rb
+++ b/activerecord/lib/active_record/schema_dumper.rb
@@ -132,10 +132,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|"