Sha256: 7de9eeba2ed9ace081ce9fdeabbb8f8ae0f34c784c6c56a05df37fa64b1f54fc
Contents?: true
Size: 803 Bytes
Versions: 2
Compression:
Stored size: 803 Bytes
Contents
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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mdd-3.0.2 | lib/generators/mdwa/code/templates/migration.rb |
mdd-3.0.1 | lib/generators/mdwa/code/templates/migration.rb |