From 57ad76729bc9ff99a96f88f081bc4731ea82bcee Mon Sep 17 00:00:00 2001 From: Norman Clarke Date: Mon, 15 Aug 2011 11:37:02 -0300 Subject: [PATCH] Added back generator from 4.0.0 branch [ci skip] --- lib/generators/friendly_id_generator.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/generators/friendly_id_generator.rb b/lib/generators/friendly_id_generator.rb index 5db92bf20..ebe2ba39d 100644 --- a/lib/generators/friendly_id_generator.rb +++ b/lib/generators/friendly_id_generator.rb @@ -1,16 +1,16 @@ require 'rails/generators' require 'rails/generators/migration' +# This generator adds a migration for the {FriendlyId::History +# FriendlyId::History} addon. class FriendlyIdGenerator < Rails::Generators::Base - include Rails::Generators::Migration - source_root File.expand_path('../../../generators/friendly_id/templates', __FILE__) - - class_option :"skip-migration", :type => :boolean, :desc => "Don't generate a migration for the slugs table" + source_root File.expand_path('../../friendly_id', __FILE__) + # Copies the migration template to db/migrate. def copy_files(*args) - migration_template 'create_slugs.rb', "db/migrate/create_slugs.rb" unless options["skip-migration"] + migration_template 'migration.rb', 'db/migrate/create_friendly_id_slugs.rb' end # Taken from ActiveRecord's migration generator @@ -21,5 +21,4 @@ def self.next_migration_number(dirname) #:nodoc: "%.3d" % (current_migration_number(dirname) + 1) end end - end \ No newline at end of file