Module: Attachs::ActiveRecord::ConnectionAdapters::AbstractAdapter
- Defined in:
- lib/attachs/active_record/connection_adapters.rb
Instance Method Summary collapse
- #add_attachment(table_name, *attachment_names) ⇒ Object
- #remove_attachment(table_name, *attachment_names) ⇒ Object
Instance Method Details
#add_attachment(table_name, *attachment_names) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/attachs/active_record/connection_adapters.rb', line 12 def (table_name, *) .each do || COLUMNS.each do |column_name, column_type| add_column table_name, "#{attachment_name}_#{column_name}", column_type end end end |
#remove_attachment(table_name, *attachment_names) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/attachs/active_record/connection_adapters.rb', line 20 def (table_name, *) .each do || COLUMNS.each do |column_name, column_type| remove_column table_name, "#{attachment_name}_#{column_name}" end end end |