Class: Permisi::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/permisi/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



14
15
16
# File 'lib/generators/permisi/install_generator.rb', line 14

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

Instance Method Details

#create_initializerObject



18
19
20
# File 'lib/generators/permisi/install_generator.rb', line 18

def create_initializer
  template "initializer.rb", "config/initializers/permisi.rb"
end

#create_migrationsObject



22
23
24
# File 'lib/generators/permisi/install_generator.rb', line 22

def create_migrations
  migration_template "migration.rb", "db/migrate/create_permisi_tables.rb", migration_version: migration_version
end