Module: SchemaComments::ConnectionAdapters::TableDefinition

Defined in:
lib/schema_comments/connection_adapters.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commentObject

Returns the value of attribute comment.



19
20
21
# File 'lib/schema_comments/connection_adapters.rb', line 19

def comment
  @comment
end

Class Method Details

.included(mod) ⇒ Object



14
15
16
17
18
# File 'lib/schema_comments/connection_adapters.rb', line 14

def self.included(mod)
  mod.module_eval do
    alias_method_chain(:column, :schema_comments)
  end
end

Instance Method Details

#column_with_schema_comments(name, type, options = {}) ⇒ Object



21
22
23
24
25
26
# File 'lib/schema_comments/connection_adapters.rb', line 21

def column_with_schema_comments(name, type, options = {})
  column_without_schema_comments(name, type, options)
  column = self[name]
  column.comment = options[:comment]
  self
end