What needs to be changed in the below queries?. i want all those employees whose date_of_leaving is null or the date_of_leaving is in between the past 60 days or the date_of_leaving is greater than or equal to the Date.today or current date.
employees = @company.employees.where('date_of_leaving BETWEEN ? AND ? OR date_of_leaving IS NULL OR date_of_leaving IS >= Date.today', Date.today - 60, Date.today)
i tried in another way also like below.
employees = Company.find(4).employees.where('date_of_leaving BETWEEN ? AND ? OR date_of_leaving IS NULL OR date_of_leaving IS >= ?', Date.today - 60, Date.today,Date.today)