Class: I18n::ActiveRecord::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_initializerObject



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

def copy_initializer
  tpl = "#{options[:simple] ? 'simple' : 'advanced'}_initializer.rb.erb"

  template tpl, 'config/initializers/i18n_active_record.rb'
end

#create_migrationsObject



23
24
25
# File 'lib/generators/i18n/active_record/install_generator.rb', line 23

def create_migrations
  migration_template 'migration.rb.erb', "db/migrate/create_#{table_name}.rb"
end