Class: Rails::Generators::LocalizedActiveRecordGenerator
- Inherits:
-
NamedBase
- Object
- NamedBase
- Rails::Generators::LocalizedActiveRecordGenerator
- Defined in:
- lib/generators/rails/localized_active_record/localized_active_record_generator.rb
Instance Method Summary collapse
Instance Method Details
#call_original_model ⇒ Object
11 12 13 |
# File 'lib/generators/rails/localized_active_record/localized_active_record_generator.rb', line 11 def call_original_model invoke('active_record:model', ARGV, {migration: true, timestamps: true}) end |
#create_localization_file ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/generators/rails/localized_active_record/localized_active_record_generator.rb', line 15 def create_localization_file [:locale].reject {|loc| loc == 'en'} [:locale].insert(0, 'en') [:locale].each do |loc| @locale = loc template 'localize.yml.erb', "config/locales/#{singular_name}.#{@locale}.yml" end end |