Open rmm5t opened 11 months ago
Great idea, however, normalizes only works for ActiveRecord. I think this is a major blocker, unless you want to have two different versions to maintain. One for ActiveRecord and one for ActiveModel etc.
I opened a "feature request" in the ruby on rails forum. Maybe you want to support this (with a "hear" and/or a comment) https://discuss.rubyonrails.org/t/proposal-activemodel-normalization/85405
There would be some benefits: The normalizes API overrides the setter - in addition to a before_validation. And it applies also for where clauses.
Similar idea as #43
Investigate and perhaps consider using the new normalizes API in Rails 7.1 instead of a before_validation callback.
This would result in a major version bump for strip_attributes, but I would still like to attempt to maintain both forwards and backwards compatibility, to some extent possible.