Sha256: 3f2176358670795908d4f5bf65c441916f37a1c317a52975d0e321d88a58804b

Contents?: true

Size: 521 Bytes

Versions: 1

Compression:

Stored size: 521 Bytes

Contents

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

module Bodega
  module Generators
    class ProductGenerator < 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/product/product_generator.rb