How to Search for Records in a Database within a Date Range in Rails

The following ActiveRecord query will pull in the posts that were created in the past week:

Post.where(created_at: (Date.today - 7.days)..Date.today)