Class: Seorel::InstallGenerator
- Inherits:
-
ActiveRecord::Generators::Base
- Object
- ActiveRecord::Generators::Base
- Seorel::InstallGenerator
- Defined in:
- lib/generators/seorel/install_generator.rb
Overview
This generator adds a migration and aa configuration initializer
Instance Method Summary collapse
-
#copy_files ⇒ Object
Copies the migration template to db/migrate.
- #cpoy_sample_locale ⇒ Object
- #create_initializer ⇒ Object
Instance Method Details
#copy_files ⇒ Object
Copies the migration template to db/migrate.
16 17 18 19 |
# File 'lib/generators/seorel/install_generator.rb', line 16 def copy_files return if ['skip-migration'] migration_template 'migration.rb', 'db/migrate/create_seorel_seorels.rb' end |
#cpoy_sample_locale ⇒ Object
26 27 28 |
# File 'lib/generators/seorel/install_generator.rb', line 26 def cpoy_sample_locale copy_file 'seorel.en.yml', 'config/locales/seorel.en.yml' end |
#create_initializer ⇒ Object
21 22 23 24 |
# File 'lib/generators/seorel/install_generator.rb', line 21 def create_initializer return if ['skip-initializer'] copy_file 'initializer.rb', 'config/initializers/seorel.rb' end |