Class: Kuroko2ReadOnly::InstallGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



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

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

Instance Method Details

#create_migration_fileObject



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

def create_migration_file
  template_name = 'add_read_only_column_to_users.kuroko2.rb'
  migration_template template_name, "db/migrate/#{template_name}"
end