Sha256: 41b145ff9fc32354fcd41aac3d8b7714639495dfdf374e705b6cd06724346f6e
Contents?: true
Size: 804 Bytes
Versions: 10
Compression:
Stored size: 804 Bytes
Contents
class <%= migration_name %> < ActiveRecord::Migration def self.up <% attachments.each do |attachment| -%> add_column :<%= class_name.underscore.camelize.tableize %>, :<%= attachment %>_file_name, :string add_column :<%= class_name.underscore.camelize.tableize %>, :<%= attachment %>_content_type, :string add_column :<%= class_name.underscore.camelize.tableize %>, :<%= attachment %>_file_size, :integer <% end -%> end def self.down <% attachments.each do |attachment| -%> remove_column :<%= class_name.underscore.camelize.tableize %>, :<%= attachment %>_file_name remove_column :<%= class_name.underscore.camelize.tableize %>, :<%= attachment %>_content_type remove_column :<%= class_name.underscore.camelize.tableize %>, :<%= attachment %>_file_size <% end -%> end end
Version data entries
10 entries across 10 versions & 6 rubygems