Sha256: 9ccf249085505f4b4f516815df35d7efc890a15eae9daaee4eaacec478109952

Contents?: true

Size: 536 Bytes

Versions: 4

Compression:

Stored size: 536 Bytes

Contents

require 'rails/generators/active_record'

class ConfigureMeGenerator < ActiveRecord::Generators::Base #Rails::Generators::NamedBase
  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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
configure_me-0.3.2 lib/generators/configure_me_generator.rb
configure_me-0.3.1 lib/generators/configure_me_generator.rb
configure_me-0.2.1 lib/generators/configure_me_generator.rb
configure_me-0.1.1 lib/generators/configure_me_generator.rb