Module: ActiveRecord::Comments::ColumnExt
- Defined in:
- lib/activerecord-comments/column_ext.rb
Instance Attribute Summary collapse
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
Instance Attribute Details
#table_name ⇒ Object (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
#comment ⇒ Object
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 |