diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-06-10 07:57:22 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-06-10 07:57:22 +0900 |
commit | a31e837431ee131fbc6900f1b3c3d6ef09753f7a (patch) | |
tree | 6ba1db0e9e255627c541053afdf1f50c2a9e9862 /activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb | |
parent | f9a39e0d51400c62348e6e299d4c53e9eababef2 (diff) | |
download | rails-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/connection_adapters/postgresql/schema_statements.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb index 6318b1c65a..4a7a166e5b 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb @@ -238,6 +238,10 @@ module ActiveRecord PostgreSQLColumn.new(*args) end + def table_options(table_name) # :nodoc: + { comment: table_comment(table_name) } + end + # Returns a comment stored in database for given table def table_comment(table_name) # :nodoc: name = Utils.extract_schema_qualified_name(table_name.to_s) |