Class: Kuhsaft::Translations::Add
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Kuhsaft::Translations::Add
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/kuhsaft/translations/add_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
13 14 15 |
# File 'lib/generators/kuhsaft/translations/add_generator.rb', line 13 def self.next_migration_number(dirname) ActiveRecord::Generators::Base.next_migration_number(dirname) end |
Instance Method Details
#create_locale_migration_file ⇒ Object
20 21 22 |
# File 'lib/generators/kuhsaft/translations/add_generator.rb', line 20 def create_locale_migration_file migration_template('add_translation.html.erb', Rails.root.join('db', 'migrate', "add_#{get_locale}_translation.rb")) end |
#get_locale ⇒ Object
17 18 19 |
# File 'lib/generators/kuhsaft/translations/add_generator.rb', line 17 def get_locale locale.downcase.underscore end |