Sha256: 88e50d00355701b35bed43bf07ae0a92197e801ea9efa8d643777ff76573fa95
Contents?: true
Size: 974 Bytes
Versions: 71
Compression:
Stored size: 974 Bytes
Contents
class <%= migration_class_name %> < ActiveRecord::Migration def self.up <% attachment_names.each do |attachment| -%> add_column :<%= name.underscore.camelize.tableize %>, :<%= attachment %>_file_name, :string add_column :<%= name.underscore.camelize.tableize %>, :<%= attachment %>_content_type, :string add_column :<%= name.underscore.camelize.tableize %>, :<%= attachment %>_file_size, :integer add_column :<%= name.underscore.camelize.tableize %>, :<%= attachment %>_updated_at, :datetime <% end -%> end def self.down <% attachment_names.each do |attachment| -%> remove_column :<%= name.underscore.camelize.tableize %>, :<%= attachment %>_file_name remove_column :<%= name.underscore.camelize.tableize %>, :<%= attachment %>_content_type remove_column :<%= name.underscore.camelize.tableize %>, :<%= attachment %>_file_size remove_column :<%= name.underscore.camelize.tableize %>, :<%= attachment %>_updated_at <% end -%> end end
Version data entries
71 entries across 71 versions & 23 rubygems