Module: ActiveRecord::Comments::ColumnExt

Defined in:
lib/activerecord-comments/column_ext.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#table_nameObject (readonly)

Returns the value of attribute table_name.



2
3
4
# File 'lib/activerecord-comments/column_ext.rb', line 2

def table_name
  @table_name
end

Instance Method Details

#commentObject



4
5
6
7
# File 'lib/activerecord-comments/column_ext.rb', line 4

def comment
  raise "table_name not set for column #{ self.inspect }" if table_name.nil? or table_name.empty?
  ActiveRecord::Base.column_comment name, table_name
end