From 1683410c5eb92882e0d2b886f79eaba15eed23fd Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Tue, 19 Apr 2016 12:16:24 -0700 Subject: Database comments: Treat blank comments as no comment. Don't dump blank comments. --- .../lib/active_record/connection_adapters/abstract/schema_dumper.rb | 2 +- activerecord/lib/active_record/schema_dumper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb index 6b5fad00ab..677a4c6bd0 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rb @@ -46,7 +46,7 @@ module ActiveRecord spec[:collation] = collation end - spec[:comment] = column.comment.inspect if column.comment + spec[:comment] = column.comment.inspect if column.comment.present? spec end diff --git a/activerecord/lib/active_record/schema_dumper.rb b/activerecord/lib/active_record/schema_dumper.rb index b4229cba04..c2662ec476 100644 --- a/activerecord/lib/active_record/schema_dumper.rb +++ b/activerecord/lib/active_record/schema_dumper.rb @@ -138,7 +138,7 @@ HEADER table_options = @connection.table_options(table) tbl.print ", options: #{table_options.inspect}" unless table_options.blank? - if comment = @connection.table_comment(table) + if comment = @connection.table_comment(table).presence tbl.print ", comment: #{comment.inspect}" end -- cgit v1.2.3