ruby on rails parameter compare date with datetime?

Viewed 3495

I receive this parameter: param[:date] = '2017-03-04'

and the column in my database is created_at with this format: '2017-01-01 09:21:23'

When I execute this query

Mymodel.where(created_at: params[:date]) 

It returns an empty array, and it is logic due the time that is not passed

I need all the rows that corresponds to the param date.

How can I do this? The time is not important in this case, I only need the date.
I am using postgres as db.

I need to select e.g. All Sell of a specific day and the column to search is created_at.

1 Answers
Related