Class: ActiveRecord::Generators::InstallGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/active_record/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_global_roles_migrationObject



9
10
11
# File 'lib/generators/active_record/install_generator.rb', line 9

def copy_global_roles_migration
  migration_template "migration.rb", "db/migrate/add_global_role_to_#{table_name}"
end

#default_valueObject



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

def default_value
  args.first == -1 ? 0 : args.first
end

#model_pathObject



13
14
15
# File 'lib/generators/active_record/install_generator.rb', line 13

def model_path
  File.join("app", "models", "#{file_path}.rb")
end