Sha256: 3cde4a81def7c6ed1fd334038171e29a2992b2231da0999bc0c2fae2145f578d
Contents?: true
Size: 740 Bytes
Versions: 27
Compression:
Stored size: 740 Bytes
Contents
require "rails/generators" require "generators/statesman/generator_helpers" # Add statesman attributes to a pre-existing transition class module Statesman class MigrationGenerator < Rails::Generators::Base include Statesman::GeneratorHelpers desc "Add the required Statesman attributes to your transition model" argument :parent, type: :string, desc: "Your parent model name" argument :klass, type: :string, desc: "Your transition model name" source_root File.expand_path('../templates', __FILE__) def create_model_file template("update_migration.rb.erb", file_name) end private def file_name "db/migrate/#{next_migration_number}_add_statesman_to_#{table_name}.rb" end end end
Version data entries
27 entries across 26 versions & 2 rubygems