Rails where records are between begining of a day and end of a day
AREL trick
Rails
ActiveSupport
1.day.ago.beginning_of_day User.where(created_at: 1.day.ago.beginning_of_day..Time.now.end_of_day)
Local timezone
DateTime.civil_from_format( :local, 2011, 01, 01 ).end_of_day # => Sat, 01 Jan 2011 23:59:59 -0700