While trying to upgrade my application to Rails 7, I came across the following deprecation warning :
ActiveRecord::Base.default_timezone is deprecated and will be removed in Rails 7.1. UseActiveRecord.default_timezoneinstead.On further inspection, i found that this is being thrown by the
validates_timelinessgem which has not been updated yet.A PR addressing this issue has been made by Mitsuru, but the owner of the gem hasn't merged it yet. I'm guessing that the gem isn't being actively worked on now.
My question is this, in Rails 7, can I validate Date and Time (formats and >,< operations) without using an external gem?
If not, is there a replacement for validates_timeliness gem that is actively being worked on?
In my app, the way that i'm using the validates_timeliness gem is as follows :
validates :graduation_date, timeliness: { type: :date }, unless: lambda{ |e| e.graduation_date_not_required.present? } validates :start_date, timeliness: { type: :date } validates :end_date, timeliness: { type: :date }, unless: :is_current?