Class: FriendlyIdGenerator
- Inherits:
-
ActiveRecord::Generators::Base
- Object
- ActiveRecord::Generators::Base
- FriendlyIdGenerator
- Defined in:
- lib/generators/friendly_id_generator.rb
Overview
This generator adds a migration for the FriendlyId::History addon.
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.
17 18 19 20 |
# File 'lib/generators/friendly_id_generator.rb', line 17 def copy_files return if ["skip-migration"] migration_template "migration.rb", "db/migrate/create_friendly_id_slugs.rb" end |
#create_initializer ⇒ Object
22 23 24 25 |
# File 'lib/generators/friendly_id_generator.rb', line 22 def create_initializer return if ["skip-initializer"] copy_file "initializer.rb", "config/initializers/friendly_id.rb" end |