Sha256: 70394066f21bf9426ac676bff295e249d8fff1330aedd4e54874f5ba5ba3baab

Contents?: true

Size: 692 Bytes

Versions: 9

Compression:

Stored size: 692 Bytes

Contents

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

module Yodeler
  class InstallGenerator < ::Rails::Generators::Base
    include ::Rails::Generators::Migration

    source_root File.expand_path('../templates', __FILE__)
    desc 'Generates (but does not run) a migration to add yodeler tables and an initializer.'

    def create_migration_file
      migration_template 'migration.rb', 'db/migrate/create_yodeler_tables.rb'
    end

    def create_initializer
      copy_file 'initializer.rb', 'config/initializers/yodeler.rb'
    end    

    def self.next_migration_number(dirname)
      ::ActiveRecord::Generators::Base.next_migration_number(dirname)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
yodeler-0.0.10 lib/generators/yodeler/install_generator.rb
yodeler-0.0.9 lib/generators/yodeler/install_generator.rb
yodeler-0.0.8 lib/generators/yodeler/install_generator.rb
yodeler-0.0.7 lib/generators/yodeler/install_generator.rb
yodeler-0.0.6 lib/generators/yodeler/install_generator.rb
yodeler-0.0.5 lib/generators/yodeler/install_generator.rb
yodeler-0.0.4 lib/generators/yodeler/install_generator.rb
yodeler-0.0.3 lib/generators/yodeler/install_generator.rb
yodeler-0.0.1 lib/generators/yodeler/install_generator.rb