You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could not find an example in the documentation on how to achieve that.
I want to fetch all records not created in a specific year.
I don't like this approach:
[3] pry(main)> Reservation.where.not(id: Reservation.by_year(2020)).to_sql
=> "SELECT \"reservations\".* FROM \"reservations\" WHERE \"reservations\".\"id\" NOT IN (SELECT \"reservations\".\"id\" FROM \"reservations\" WHERE (reservations.created_at >= '2019-12-31 23:00:00' AND reservations.created_at <= '2020-12-31 22:59:59.999999'))"
because I get a nested query which is not necessary.
I could not find an example in the documentation on how to achieve that.
I want to fetch all records not created in a specific year.
I don't like this approach:
because I get a nested query which is not necessary.
I tried:
but it does not work since
where_values_hash
returns{}
.Help? 😄
The text was updated successfully, but these errors were encountered: