rails activerecord available between code example
Example: how to use between in active record
Client.where(created_at: (Time.now.midnight - 1.day)..Time.now.midnight)
Client.where(created_at: (Time.now.midnight - 1.day)..Time.now.midnight)