1

I just added :confirmable but am now getting an error:

NameError in Devise::RegistrationsController#create

undefined local variable or method `confirmed_at' for #<User:0x000001025db288>

I realized that after I added it, I didn't do anything that would generate a migration.

How do I get a new migration to alter the current schema on an existing devise install?

Thanks.

marcamillion
  • 32,933
  • 55
  • 189
  • 380

3 Answers3

1

Update: Here's Devise wiki page on how to change existing table to suit Devise needs:

For Devise below 2.0

https://github.com/plataformatec/devise/wiki/How-To:-change-an-already-existing-table-to-add-devise-required-columns

For Devise after 2.0

https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0-migration-schema-style

marcamillion
  • 32,933
  • 55
  • 189
  • 380
Alexey Kharchenko
  • 1,032
  • 5
  • 10
  • No I know how to create a migration. But with Devise, I don't know the exact names of the columns that are needed. This question is specific to devise's modules....not to rails db migrations ;) – marcamillion Jun 05 '12 at 02:58
  • Btw, I tried that and am now getting this error in during my `migrate`: `undefined method lconfirmable' for #` – marcamillion Jun 05 '12 at 03:34
  • The same wiki page explains this. Since 2.0 there are no more migration helpers. Check the new update. – Alexey Kharchenko Jun 05 '12 at 03:51
0

I would suggest you to take a look on this topic.

It might help you.

Community
  • 1
  • 1
Kleber S.
  • 8,110
  • 6
  • 43
  • 69
0

So it seems the best way to do this is via this Devise Wiki link.

I just tested it and it seems to work.

marcamillion
  • 32,933
  • 55
  • 189
  • 380