New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined method `password_digest=' for User while User Registration #1845
Comments
Did you run the database migrations on Heroku ( |
I had loaded the database from schema (heroku rake db:load:schema). It creates the database and does not requires any migration. |
Actually, I think I might see the problem, what does your migration look like? It looks like you're trying to use BTW you probably shouldn't include the encrypted password in |
@srkgupta Please provide the backtrace, it may help finding the error. If not, we would like to ask for a way to reproduce the issue. |
This is how migration file looks like. class DeviseCreateUsers < ActiveRecord::Migration
end And this is the backtrace: .bundle/gems/ruby/1.9.1/gems/activemodel-3.1.1/lib/active_model/attribute_methods.rb:385:in |
As @stevenh512 said, you are using ActiveModel's has_secure_password with Devise. You must not mix the two. Cheers. |
I do not have any reference to has_secure_password in my User Model. Can you please point me out where exactly is this being referenced. I had even tried removing the attr_accessible for password_digest in my User Model file. But it still displays the same error. |
Yeah, that's the problem, Remove |
@srkgupta You can clearly see secure password in the backtrace |
Thank You Guys. I was actually having an another User model file user_old.rb which had used has_secure_password in it. I removed that file and it worked. You guys Rock. Thanks once again. |
Hi,
I am getting this error "undefined method `password_digest=' for #<User" when I am trying to Sign up.
Steps I did:
class User < ActiveRecord::Base
Include default devise modules. Others available are:
:token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
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, :password_digest
end
The text was updated successfully, but these errors were encountered: