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

Version Path
refinerycms-0.9.6.34 vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb
refinerycms-0.9.6.33 vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb
refinerycms-0.9.6.32 vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb
refinerycms-0.9.6.31 vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb
refinerycms-0.9.6.30 vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb
refinerycms-0.9.6.29 vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb
refinerycms-0.9.6.28 vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb
refinerycms-0.9.6.27 vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb
refinerycms-0.9.6.26 vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb
refinerycms-0.9.6.25 vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb
refinerycms-0.9.6.24 vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb
refinerycms-0.9.6.23 vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb
refinerycms-0.9.6.22 vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb
refinerycms-0.9.6.21 vendor/plugins/friendly_id/generators/friendly_id/friendly_id_generator.rb
friendly_id-2.3.4 generators/friendly_id/friendly_id_generator.rb
friendly_id-2.3.3 generators/friendly_id/friendly_id_generator.rb
friendly_id-2.3.2 generators/friendly_id/friendly_id_generator.rb
friendly_id-2.3.1 generators/friendly_id/friendly_id_generator.rb
friendly_id-2.3.0 generators/friendly_id/friendly_id_generator.rb