Sha256: 911b88afc928074498d16b23294d471e69605bd9b380086183b73396b107dfad
Contents?: true
Size: 831 Bytes
Versions: 7
Compression:
Stored size: 831 Bytes
Contents
# -*- encoding : utf-8 -*- class Alter<%= @all_entities.select{|e| e.resource?}.collect{|e| e.file_name.camelize}.join('') %><%= @random_migration_key %> < ActiveRecord::Migration def self.up <%- @changes.each do |change| -%> <%= change[:type] %> :<%= MDWA::Generators::Model.new(change[:entity].model_name).plural_name %>, :<%= change[:column] %> <%= ", :#{change[:attr_type]}" unless change[:attr_type].blank? %> <%- end -%> end def self.down <%- @changes.each do |change| -%> <%= inverse_migration_type change[:type] %> :<%= MDWA::Generators::Model.new(change[:entity].model_name).plural_name %>, :<%= change[:column] %> <%= ", :#{change[:attr_type]}" if inverse_migration_type(change[:type]) == 'add_column' %> <%= ", :#{change[:from]}" unless change[:from].blank? %> <%- end -%> end end
Version data entries
7 entries across 7 versions & 1 rubygems