Ruby Datamapper.count always returns 0

Whenever I try to count the returned records from a datamapper, it always returns as 0, whether the user is or not.

User.count(:username=>params[:username]) class User include DataMapper::Resource property :id, Serial property :username, String, unique_index: true, required: true, length: 3..32 property :password, String, required: true, length: 5..64 property :email, String, unique_index: true, required: true, format: :email_address end 
0
source share
1 answer

Can you try User.all(:username=>params[:username]) in the console and then try

User.count(:username=>params[:username]) for this ENV

0
source

All Articles