title: ArgumentError when using Devise and has_secure_password together
body: <p>I had a working model prior to adding Devise gem. After I installed Devise and ran <code>rails generate devise User</code>, I started having this error.</p>
  
  <p>Whenever I go to rails console and typed </p>
  
  <p><code>User.first</code></p>
  
  <p>or </p>
  
  <p><code>User.create(username: "Iggy1", email: "iggy1@gmail.com", password: "helloworld", password_confirmation: "helloworld")</code></p>
  
  <p>It always returns </p>
  
  <pre><code>  User Load (0.3ms)  SELECT  "users".* FROM "users"  ORDER BY "users"."id" ASC LIMIT 1
  ArgumentError: wrong number of arguments (0 for 1)
      from /Users/iggy/.rvm/gems/ruby-2.2.2/gems/devise-4.2.0/lib/devise/models/database_authenticatable.rb:146:in `password_digest'
      from /Users/iggy/.rvm/gems/ruby-2.2.2/gems/activemodel-4.2.5/lib/active_model/serialization.rb:108:in `block in serializable_hash'
      from /Users/iggy/.rvm/gems/ruby-2.2.2/gems/activemodel-4.2.5/lib/active_model/serialization.rb:108:in `each'
      from /Users/iggy/.rvm/gems/ruby-2.2.2/gems/activemodel-4.2.5/lib/active_model/serialization.rb:108:in `serializable_hash'
      from /Users/iggy/.rvm/gems/ruby-2.2.2/gems/activerecord-4.2.5/lib/active_record/serialization.rb:17:in `serializable_hash'
      from /Users/iggy/.rvm/gems/ruby-2.2.2/gems/devise-4.2.0/lib/devise/models/authenticatable.rb:114:in `serializable_hash'
      from /Users/iggy/.rvm/gems/ruby-2.2.2/gems/devise-4.2.0/lib/devise/models/authenticatable.rb:120:in `inspect'
      from /Users/iggy/.rvm/gems/ruby-2.2.2/gems/railties-4.2.5/lib/rails/commands/console.rb:110:in `start'
      from /Users/iggy/.rvm/gems/ruby-2.2.2/gems/railties-4.2.5/lib/rails/commands/console.rb:9:in `start'
      from /Users/iggy/.rvm/gems/ruby-2.2.2/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:68:in `console'
      from /Users/iggy/.rvm/gems/ruby-2.2.2/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
      from /Users/iggy/.rvm/gems/ruby-2.2.2/gems/railties-4.2.5/lib/rails/commands.rb:17:in `&lt;top (required)&gt;'
      from bin/rails:4:in `require'
      from bin/rails:4:in `&lt;main&gt;'
  </code></pre>
  
  <p>I kept getting <code>wrong number of arguments (0 for 1)</code> error. I can understand it returns argument error for <code>create</code> method (maybe I specified less parameters), but I don't understand why it shows that error on <code>User.first</code>.</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>users_controller.rb
  
    ...
    def new
      @user = User.new
    end
  
    def create
      @user = User.new(user_params)
    end
  
    def user_params
      params.require(:user).permit(:name, :email, :password, :password_confirmation)
    end
  
  
  Schema.rb
  
    create_table "users", force: :cascade do |t|
      t.string   "name"
      t.datetime "created_at",                          null: false
      t.datetime "updated_at",                          null: false
      t.string   "password_digest"
      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,  null: false
      t.datetime "current_sign_in_at"
      t.datetime "last_sign_in_at"
      t.string   "current_sign_in_ip"
      t.string   "last_sign_in_ip"
    end
  
  
  user.rb (model)
  
    devise :database_authenticatable, :registerable,
           :recoverable, :rememberable, :trackable, :validatable
  
    has_many :lists
    has_many :items, through: :lists
    has_secure_password
  </code></pre>
  
  <p>There is at least a user in the DB. On localhost index, it shows (I am using serializer):</p>
  
  <pre><code>{"users":[{"id":1,"name":"Iggy1","email":"letsmailiggy@gmail.com","items":[],"lists":[]}]}
  </code></pre>
  
  <p>I also has <code>has_secure_password</code> on model. Could that be the cause? I was not sure if <code>has_secure_password</code> is compatible with <code>Devise</code>. How can I fix it so I can create user on rails console?</p>
  
  <p>If you need more code snippet, please let me know!</p>