Sha256: 5fb7f0c05cc7033800aaaabae69675a577ee063e02073eab8aa0eae127828b30
Contents?: true
Size: 546 Bytes
Versions: 203
Compression:
Stored size: 546 Bytes
Contents
class <%= class_name.underscore.camelize %> < ActiveRecord::Migration 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
203 entries across 175 versions & 16 rubygems