Class: Merrycms::InstallTranslationsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Merrycms::InstallTranslationsGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/merrycms/install_translations_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/generators/merrycms/install_translations_generator.rb', line 12 def self.next_migration_number(dirname) if ActiveRecord::Base. Time.now.utc.strftime("%Y%m%d%H%M%S") else "%.3d" % (current_migration_number(dirname) + 1) end end |
.source_root ⇒ Object
8 9 10 |
# File 'lib/generators/merrycms/install_translations_generator.rb', line 8 def self.source_root @source_root ||= File.join(File.dirname(__FILE__), 'templates') end |
Instance Method Details
#copy_locale_initializer ⇒ Object
25 26 27 |
# File 'lib/generators/merrycms/install_translations_generator.rb', line 25 def copy_locale_initializer copy_file 'locale_initializer.rb', 'config/initializers/locale.rb' end |
#create_translations_migration_files ⇒ Object
20 21 22 23 |
# File 'lib/generators/merrycms/install_translations_generator.rb', line 20 def create_translations_migration_files migration_template 'create_translations_migration.rb', 'db/migrate/create_translations.rb' sleep 1 end |