Rails 7.1 Introduces ActiveRecord::Base::Normalization | Saeloun Blog
03-Nov-2023 1038
Using ActiveRecord::Base::Normalization we can specify unique normalization rules for model attributes. When an attribute is assigned or changed, normalization is applied, and the normalised value is stored in the database.To enable records to be queried using unnormalized values, the normalization is also done to the matching keyword argument of query methods. These rules are applied during data assignment and updates, ensuring that data is stored in a consistent and standardized format in the database.Before Rails 7.1, we could normalize attributes using before_save callback.
Rails 7.1 Introduces ActiveRecord::Base::Normalization | Saeloun Blog #ruby #rubydeveloper #rubyonrails #Rails #Introduces #ActiveRecord::Base::Normalization #Saeloun #activerecord::base::normalization #blog https://rubyonrails.ba/link/rails-7-1-introduces-activerecord-base-normalization-saeloun-blog