Rails ActiveRecord search records between two dates
Yeah, this is simple in Rails. date = Date.today start_date = date.at_beginning_of_month end_date = date.at_end_of_month Model.where(:created_at => start_date..end_date) This gives the records created in current month. This is simple because rails save created_at and updated_at in following format: created_at: “2018-09-03 09:49:41” But here in my …
Read More