Class: SeorelGenerator
- Inherits:
-
ActiveRecord::Generators::Base
- Object
- ActiveRecord::Generators::Base
- SeorelGenerator
- Defined in:
- lib/generators/seorel_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.
- #create_initializer ⇒ Object
Instance Method Details
#copy_files ⇒ Object
Copies the migration template to db/migrate.
16 17 18 19 |
# File 'lib/generators/seorel_generator.rb', line 16 def copy_files return if ['skip-migration'] migration_template 'migration.rb', 'db/migrate/create_seorel_seorels.rb' end |
#create_initializer ⇒ Object
21 22 23 24 |
# File 'lib/generators/seorel_generator.rb', line 21 def create_initializer return if ['skip-initializer'] copy_file 'initializer.rb', 'config/initializers/seorel.rb' end |