In my project I need to have ability ti add reports. Adding a report user can choose date for placing his report. (not created_at) I save this data in \"Date\":DataTime - fo
No. You should calculate margin dates and use :date => range (it will create sql BETWEEN query). For example:
:date => range
month = params[:month].to_i date_a = DateTime.new Date.today.year, month, 1 date_b = (date_a >> 1) + 1 # will add a month and a day Page.all :updated_at => date_a..date_b