Browse files

Chagned the copy_devise_migration method to properly handle the :revo…

…ke behavior using @daf's commit: daf/devise@acf7e9e as a guide.
  • Loading branch information...
1 parent 179cb2c commit 99d539b9a79bbc1db3d77f40e890636b5addb5a4 @seanski committed Aug 28, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/generators/active_record/devise_generator.rb
View
4 lib/generators/active_record/devise_generator.rb
@@ -10,7 +10,9 @@ class DeviseGenerator < ActiveRecord::Generators::Base
source_root File.expand_path("../templates", __FILE__)
def copy_devise_migration
- unless model_exists?
+ exists = model_exists?
+ exists = !exists if behavior == :revoke
+ unless exists
migration_template "migration.rb", "db/migrate/devise_create_#{table_name}"
else
migration_template "migration_existing.rb", "db/migrate/add_devise_to_#{table_name}"

0 comments on commit 99d539b

Please sign in to comment.