Sha256: 3f776e522053c32968ed5b7637cf4f90bd3138555a866a6a6e21f3a8931a0dfa

Contents?: true

Size: 524 Bytes

Versions: 1

Compression:

Stored size: 524 Bytes

Contents

require 'rails/generators/migration'
require 'rails/generators/active_record/migration'

module Bodega
  module Generators
    class ProductizeGenerator < Rails::Generators::Base
      argument :product_name, type: :string

      include Rails::Generators::Migration
      extend ActiveRecord::Generators::Migration

      source_root File.expand_path('../templates', __FILE__)

      def copy_migration
        migration_template("migration.rb", "db/migrate/bodegaize_#{product_name.tableize}")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bodega-0.2.0 lib/generators/bodega/productize/productize_generator.rb