Sha256: f0e7faba8ef4e6f310bd01b416f7b04e25aee0b4718700ec778e604acf5dc45d
Contents?: true
Size: 551 Bytes
Versions: 16
Compression:
Stored size: 551 Bytes
Contents
class <%= class_name.underscore.camelize %> < ActiveRecord::Migration[5.1] def self.up<% attributes.each do |attribute| %> <%= migration_action %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'add' %>, :<%= attribute.type %><% end -%> <%- end %> end def self.down<% attributes.reverse.each do |attribute| %> <%= migration_action == 'add' ? 'remove' : 'add' %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'remove' %>, :<%= attribute.type %><% end -%> <%- end %> end end
Version data entries
16 entries across 16 versions & 1 rubygems