Rails 7.1 AR adds normalizes API for attribute values
Sometimes you may want to standardize the data before saving it to the database. For example, downcasing emails, removing any leading and trailing whitespaces, and so on. Rails 7.1 adds
ActiveRecord::Base::normalizes
API, which allows you to normalize attribute values to a common format before saving them to the database. This can help improve the integrity and consistency of your data and make it simpler to query records based on attribute values.
Source: Rails 7.1 AR adds normalizes API for attribute values
A nice idea!