Sha256: 2dc1d72c779586c28e24d8de61ad9be18f5433ae99a5167caa6f5501ebfa7d78
Contents?: true
Size: 704 Bytes
Versions: 12
Compression:
Stored size: 704 Bytes
Contents
require 'rails/generators/active_record' module ActiveRecord module Generators class MeritGenerator < ActiveRecord::Generators::Base include Rails::Generators::Migration source_root File.expand_path('../templates', __FILE__) desc "add active_record merit migrations" def self.next_migration_number(path) unless @prev_migration_nr @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i else @prev_migration_nr += 1 end @prev_migration_nr.to_s end def copy_migrations_and_model migration_template "add_fields_to_model.rb", "db/migrate/add_fields_to_#{table_name}" end end end end
Version data entries
12 entries across 12 versions & 1 rubygems