Class: MigrationComments::ActiveRecord::ConnectionAdapters::CommentDefinition
- Inherits:
-
Struct
- Object
- Struct
- MigrationComments::ActiveRecord::ConnectionAdapters::CommentDefinition
- Defined in:
- lib/migration_comments/active_record/connection_adapters/comment_definition.rb
Instance Attribute Summary collapse
-
#column_name ⇒ Object
Returns the value of attribute column_name.
-
#comment_text ⇒ Object
Returns the value of attribute comment_text.
-
#table_name ⇒ Object
Returns the value of attribute table_name.
Instance Method Summary collapse
Instance Attribute Details
#column_name ⇒ Object
Returns the value of attribute column_name
2 3 4 |
# File 'lib/migration_comments/active_record/connection_adapters/comment_definition.rb', line 2 def column_name @column_name end |
#comment_text ⇒ Object
Returns the value of attribute comment_text
2 3 4 |
# File 'lib/migration_comments/active_record/connection_adapters/comment_definition.rb', line 2 def comment_text @comment_text end |
#table_name ⇒ Object
Returns the value of attribute table_name
2 3 4 |
# File 'lib/migration_comments/active_record/connection_adapters/comment_definition.rb', line 2 def table_name @table_name end |
Instance Method Details
#table_comment? ⇒ Boolean
9 10 11 |
# File 'lib/migration_comments/active_record/connection_adapters/comment_definition.rb', line 9 def table_comment? column_name.blank? end |
#to_dump ⇒ Object
3 4 5 6 7 |
# File 'lib/migration_comments/active_record/connection_adapters/comment_definition.rb', line 3 def to_dump table_comment? ? "set_table_comment :#{table_name}, %{#{comment_text}}" : "set_column_comment :#{table_name}, :#{column_name}, %{#{comment_text}}" end |