Rails 7.1 Introduces ActiveRecord::Base::Normalization | Saeloun Blog

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 #activerecord::base::normalization #blog https://rubyonrails.ba/single/rails-7-1-introduces-activerecord-base-normalization-saeloun-blog

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles