Sha256: 6e74ec3641003a4c5d9eb6cd99926c7f87962ea7c077202fd8ec6ebd9af547a8
Contents?: true
Size: 804 Bytes
Versions: 19
Compression:
Stored size: 804 Bytes
Contents
class FriendlyIdGenerator < Rails::Generator::Base def manifest record do |m| unless options[:skip_migration] m.migration_template('create_slugs.rb', 'db/migrate', :migration_file_name => 'create_slugs') end unless options[:skip_tasks] m.directory "lib/tasks" m.file "/../../../lib/friendly_id/active_record2/tasks/friendly_id.rake", "lib/tasks/friendly_id.rake" end end end protected def add_options!(opt) opt.separator '' opt.separator 'Options:' opt.on("--skip-migration", "Don't generate a migration for the slugs table") do |value| options[:skip_migration] = value end opt.on("--skip-tasks", "Don't add friendly_id Rake tasks to lib/tasks") do |value| options[:skip_tasks] = value end end end
Version data entries
19 entries across 19 versions & 2 rubygems