I'm trying to get books ActiveRecord objects that have a 'from or 'to' between a date range (start_date..end_date)
.
This code works just fine:
Book.where(from: start_date..end_date)
But I want to use 'or' in my statement and this code fails:
Book.where("from: ? OR to: ?", (start_date..end_date), (start_date..end_date))
Please help me to find my mistake.