2

Here's my user model:

class User < ActiveRecord::Base
  devise :database_authenticatable, :registerable,
        :recoverable, :rememberable, :trackable, :validatable,:confirmable

  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :remember_me

end

Here's the schema.rb:

 create_table "users", :force => true do |t|
      t.string   "email",                  :default => "", :null => false
      t.string   "encrypted_password",     :default => "", :null => false
      t.string   "reset_password_token"
      t.datetime "reset_password_sent_at"     
      t.datetime "remember_created_at"
      t.integer  "sign_in_count",          :default => 0
      t.datetime "current_sign_in_at"
      t.datetime "last_sign_in_at"
      t.string   "current_sign_in_ip"
      t.string   "last_sign_in_ip"
      t.string   "confirmation_token"
      t.datetime "confirmed_at"
      t.datetime "confirmation_sent_at"
      t.datetime "created_at",                             :null => false
      t.datetime "updated_at",                             :null => false
      t.integer  "profile_id"
      t.string   "profile_type"
end

And in my initializer, devise.rb, I set this:

config.reconfirmable = false

I receive a mail telling me to click on confirm my account, and when I do, I get this error:

NameError in Devise::ConfirmationsController#show

undefined local variable or method `unconfirmed_email' for #<User:0xaa53818>

How can I fix it?

Geo
  • 93,257
  • 117
  • 344
  • 520
  • Can you post the full backtrace? :) – José Valim Mar 29 '12 at 18:09
  • @JoséValim Sure, give me a few minutes to boot into the virtual machine. – Geo Mar 29 '12 at 18:22
  • @JoséValim, I'll be damned ... on a new environment, I cannot reproduce the issue! I'm loading up the original environment to see if I can still reproduce it there. – Geo Mar 29 '12 at 18:40
  • I could not reproduce it on my original environment either. However, I think I know what might have caused it. When I started the development server, `config.reconfirmable` was set to true, and I don't think I restarted it, after changing it in the initializer. Sounds plausible? – Geo Mar 29 '12 at 18:57

1 Answers1

3

It was not a problem with Devise, but with me not restarting the development server.

Geo
  • 93,257
  • 117
  • 344
  • 520