-
Sean Doyle authored
Follow-up to [rails/rails#53954][] Re-submission of [rails/rails#53887][] Closes [rails/rails#53793][] Follow-up to [rails/rails#43945][] To support this behavior, the bulk of the implementation is moved to the new `ActiveModel::Normalization` module. Any "persistence"-related language, methods, and test coverage has been excised. The single implementation change is related to reading and writing attributes: ```diff def normalize_attribute(name) # Treat the value as a new, unnormalized value. - self[name] = self[name] + send(:"#{name}=", send(name)) end ``` This can be undone if a change like [rails/rails#53886][] lands. [rails/rails#53954]: https://github.com/rails/rails/pull/53954 [rails/rails#53887]: https://github.com/rails/rails/pull/53887 [rails/rails#53793]: https://github.com/rails/rails/discussions/53793 [rails/rails#43945]: https://github.com/rails/rails/pull/43945 [rails/rails#53886]: https://github.com/rails/rails/pull/53886
Sean Doyle authoredFollow-up to [rails/rails#53954][] Re-submission of [rails/rails#53887][] Closes [rails/rails#53793][] Follow-up to [rails/rails#43945][] To support this behavior, the bulk of the implementation is moved to the new `ActiveModel::Normalization` module. Any "persistence"-related language, methods, and test coverage has been excised. The single implementation change is related to reading and writing attributes: ```diff def normalize_attribute(name) # Treat the value as a new, unnormalized value. - self[name] = self[name] + send(:"#{name}=", send(name)) end ``` This can be undone if a change like [rails/rails#53886][] lands. [rails/rails#53954]: https://github.com/rails/rails/pull/53954 [rails/rails#53887]: https://github.com/rails/rails/pull/53887 [rails/rails#53793]: https://github.com/rails/rails/discussions/53793 [rails/rails#43945]: https://github.com/rails/rails/pull/43945 [rails/rails#53886]: https://github.com/rails/rails/pull/53886
Loading