Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
Unable to query postgres table for a model created with Devise

I am stumped and would appreciate some help.

Using devise 4.2.1 and rails 5.0. Successfully set up devise model and create a resource. Yet, when I attempt to query the admin table in rails console, I get this error:

  2.4.0 :003 > User.all
    User Load (0.5ms)  SELECT "users".* FROM "users"
   => #<ActiveRecord::Relation []> 
  2.4.0 :004 > Admin.all
    Admin Load (1.4ms)  SELECT "admins".* FROM "admins"
  ArgumentError: wrong number of arguments (given 0, expected 1)
    from /Users/nonni/.rvm/gems/ruby-2.4.0@spree/gems/devise-4.2.1/lib/devise/models/database_authenticatable.rb:157:in `password_digest'
    from /Users/nonni/.rvm/gems/ruby-2.4.0@spree/gems/activemodel-5.0.2/lib/active_model/serialization.rb:135:in `block in serializable_hash'
    from /Users/nonni/.rvm/gems/ruby-2.4.0@spree/gems/activemodel-5.0.2/lib/active_model/serialization.rb:135:in `each'
    from /Users/nonni/.rvm/gems/ruby-2.4.0@spree/gems/activemodel-
    from /Users/nonni/.rvm/gems/ruby-2.4.0@spree/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

This line in particular seems to be where the error occurs:

4.2.1/lib/devise/models/database_authenticatable.rb:157:in `password_digest' from /Users/nonni/.rvm/gems/ruby 2.4.0@spree/gems/activemodel-  

When I inspect postico, I see the newly created record:

2 rand@user.com $2a$11$X9IcCMq9rSIz/QzTmoXfi.Se1nximWq8rRjAClpqJHgbPArJbqGAW1 2017-04-18 2017-04-18 (removed other_time_steps) 

There isn't a password_digest column on Admins table (devise generates an encryted_password column as long as it receives password as a named argument).

I also get this same error when I attempt to create a new admin in console. What could I possibly be missing? Would appreciate any pointers. Thanks!

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!