Sha256: 7e17eb5c6f9cfdd1c384d63cfc16992740b13abc1e7e6aea4c859ba67348a490

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 Bytes

Contents

module Tramway::User::Generators
  class InstallGenerator < ::Rails::Generators::Base
    include Rails::Generators::Migration
    source_root File.expand_path('../templates', __FILE__)

    desc 'Add the migrations for User'

    def self.next_migration_number(path)
      next_migration_number = current_migration_number(path) + 1
      ActiveRecord::Migration.next_migration_number next_migration_number
    end

    def copy_migrations
      migration_template 'create_users.rb', 'db/migrate/create_users.rb'
      inject_into_file 'bin/rails', "include Tramway::User\n", before: :begin
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tramway-user-0.1.0 lib/tramway/user/generators/install_generator.rb