Sha256: 0e30722847ea03c7fdaccb660d0c0a284cad66541d3a2cba838ea5d3c6bd1a10

Contents?: true

Size: 549 Bytes

Versions: 5

Compression:

Stored size: 549 Bytes

Contents

require 'rails/generators/active_record'

module ConfigureMe
  class SetupGenerator < ActiveRecord::Generators::Base
    include Rails::Generators::Migration

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

    def generate_model
      template 'model.rb', "app/models/#{singular_name}.rb"
    end

    def generate_migration
      migration_template 'migration.rb', "db/migrate/create_#{plural_name}.rb"
    end

    def generate_initializer
      template 'initializer.rb', 'config/initializers/init_configure_me.rb'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
configure_me-0.6.1 lib/generators/configure_me/setup_generator.rb
configure_me-0.6.0 lib/generators/configure_me/setup_generator.rb
configure_me-0.5.0 lib/generators/configure_me/setup_generator.rb
configure_me-0.4.1 lib/generators/configure_me/setup_generator.rb
configure_me-0.4.0 lib/generators/configure_me/setup_generator.rb