Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
- Defined in:
- lib/activerecord/connection_adapters/postgresql_adapter.rb
Instance Method Summary collapse
- #change_column_comment(table_name, column_name, comment) ⇒ Object
- #change_column_with_comment(table_name, column_name, type, options = {}) ⇒ Object
Instance Method Details
#change_column_comment(table_name, column_name, comment) ⇒ Object
13 14 15 |
# File 'lib/activerecord/connection_adapters/postgresql_adapter.rb', line 13 def change_column_comment(table_name, column_name, comment) execute "COMMENT ON COLUMN #{quote_table_name(table_name)}.#{quote_column_name(column_name)} IS '#{quote_string(comment)}'" end |
#change_column_with_comment(table_name, column_name, type, options = {}) ⇒ Object
6 7 8 9 10 |
# File 'lib/activerecord/connection_adapters/postgresql_adapter.rb', line 6 def change_column_with_comment(table_name, column_name, type, = {}) comment = .fetch(:comment){ nil } change_column_without_comment(table_name, column_name, type, = {}) change_column_comment(table_name, column_name, comment) unless comment.nil? end |