You can use the bottom stone to search for entries between dates,
This gem is pretty easy to use and more understandable [By star] [1]. I use this gem and the API is more understandable and the documentation is also well explained.
Post.between_times( Time.zone.now - 3.hours, # all posts in last 3 hours Time.zone.now )
Here you can also pass our field Post.by_month("January", field: :updated_at)
Please review the documentation and try.
Jenorish
source share