I have this search in Rails 3:
Note.where(:user_id => current_user.id, :notetype => p[:note_type], :date => p[:date]).order(\'date ASC, created_at A
Rails 6.1 added a new 'syntax' for comparison operators in where conditions, for example:
Post.where('id >': 9)
Post.where('id >=': 9)
Post.where('id <': 3)
Post.where('id <=': 3)
So your query can be rewritten as follows:
Note
.where(user_id: current_user.id, notetype: p[:note_type], 'date >', p[:date])
.order(date: :asc, created_at: :asc)
Here is a link to PR where you can find more examples.