Module: PgSaurus::Migration::CommandRecorder::CommentMethods
- Included in:
- PgSaurus::Migration::CommandRecorder
- Defined in:
- lib/pg_saurus/migration/command_recorder/comment_methods.rb
Overview
Provides methods to extend ActiveRecord::Migration::CommandRecorder to support comments feature.
Instance Method Summary collapse
-
#invert_set_column_comment(args) ⇒ Object
:nodoc:.
-
#invert_set_column_comments(args) ⇒ Object
:nodoc:.
-
#invert_set_index_comment(args) ⇒ Object
:nodoc:.
-
#invert_set_table_comment(args) ⇒ Object
:nodoc:.
-
#remove_column_comment(*args) ⇒ Object
:nodoc:.
-
#remove_column_comments(*args) ⇒ Object
:nodoc:.
-
#remove_index_comment(*args) ⇒ Object
:nodoc:.
-
#remove_table_comment(*args) ⇒ Object
:nodoc:.
-
#set_column_comment(*args) ⇒ Object
:nodoc:.
-
#set_column_comments(*args) ⇒ Object
:nodoc:.
-
#set_index_comment(*args) ⇒ Object
:nodoc:.
-
#set_table_comment(*args) ⇒ Object
:nodoc:.
Instance Method Details
#invert_set_column_comment(args) ⇒ Object
:nodoc:
51 52 53 54 55 |
# File 'lib/pg_saurus/migration/command_recorder/comment_methods.rb', line 51 def invert_set_column_comment(args) table_name = args[0] column_name = args[1] [:remove_column_comment, [table_name, column_name]] end |
#invert_set_column_comments(args) ⇒ Object
:nodoc:
58 59 60 61 |
# File 'lib/pg_saurus/migration/command_recorder/comment_methods.rb', line 58 def invert_set_column_comments(args) i_args = [args[0]] + args[1].collect{|name, value| name } [:remove_column_comments, i_args] end |
#invert_set_index_comment(args) ⇒ Object
:nodoc:
64 65 66 67 |
# File 'lib/pg_saurus/migration/command_recorder/comment_methods.rb', line 64 def invert_set_index_comment(args) index_name = args.first [:remove_index_comment, [index_name]] end |
#invert_set_table_comment(args) ⇒ Object
:nodoc:
45 46 47 48 |
# File 'lib/pg_saurus/migration/command_recorder/comment_methods.rb', line 45 def invert_set_table_comment(args) table_name = args.first [:remove_table_comment, [table_name]] end |
#remove_column_comment(*args) ⇒ Object
:nodoc:
25 26 27 |
# File 'lib/pg_saurus/migration/command_recorder/comment_methods.rb', line 25 def remove_column_comment(*args) record(:remove_column_comment, args) end |
#remove_column_comments(*args) ⇒ Object
:nodoc:
30 31 32 |
# File 'lib/pg_saurus/migration/command_recorder/comment_methods.rb', line 30 def remove_column_comments(*args) record(:remove_column_comments, args) end |
#remove_index_comment(*args) ⇒ Object
:nodoc:
40 41 42 |
# File 'lib/pg_saurus/migration/command_recorder/comment_methods.rb', line 40 def remove_index_comment(*args) record(:remove_index_comment, args) end |
#remove_table_comment(*args) ⇒ Object
:nodoc:
10 11 12 |
# File 'lib/pg_saurus/migration/command_recorder/comment_methods.rb', line 10 def remove_table_comment(*args) record(:remove_table_comment, args) end |
#set_column_comment(*args) ⇒ Object
:nodoc:
15 16 17 |
# File 'lib/pg_saurus/migration/command_recorder/comment_methods.rb', line 15 def set_column_comment(*args) record(:set_column_comment, args) end |
#set_column_comments(*args) ⇒ Object
:nodoc:
20 21 22 |
# File 'lib/pg_saurus/migration/command_recorder/comment_methods.rb', line 20 def set_column_comments(*args) record(:set_column_comments, args) end |
#set_index_comment(*args) ⇒ Object
:nodoc:
35 36 37 |
# File 'lib/pg_saurus/migration/command_recorder/comment_methods.rb', line 35 def set_index_comment(*args) record(:set_index_comment, args) end |
#set_table_comment(*args) ⇒ Object
:nodoc:
5 6 7 |
# File 'lib/pg_saurus/migration/command_recorder/comment_methods.rb', line 5 def set_table_comment(*args) record(:set_table_comment, args) end |