Class: AuditsInstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- AuditsInstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/audits_install/audits_install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
23 24 25 |
# File 'lib/generators/audits_install/audits_install_generator.rb', line 23 def self.next_migration_number(dirname) ::ActiveRecord::Generators::Base.next_migration_number(dirname) end |
Instance Method Details
#copy_audits_code ⇒ Object
18 19 20 21 |
# File 'lib/generators/audits_install/audits_install_generator.rb', line 18 def copy_audits_code @user_class = user_class_name.downcase template 'audits.txt', 'config/initializers/audits.rb' end |
#copy_change_class ⇒ Object
13 14 15 16 |
# File 'lib/generators/audits_install/audits_install_generator.rb', line 13 def copy_change_class @user_class = user_class_name.downcase template 'change.txt', 'app/models/change.rb' end |
#create_migration_file ⇒ Object
9 10 11 |
# File 'lib/generators/audits_install/audits_install_generator.rb', line 9 def create_migration_file migration_template 'create_changes.rb', 'db/migrate/create_changes.rb' end |