v2.0: drop Rails < 7.1, reimplement sanitizes on top of normalizes#1
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…DE.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Drop support for Rails 6.x and 7.0. Add Rails 7.1 and 7.2 to the Appraisal test matrix. Remove the concurrent-ruby dev dependency that was only needed for older Rails. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The sanitizes DSL is unchanged, but each declared column is now registered via Rails 7.1's normalizes API, so normalization runs at attribute assignment time instead of in a before_save callback. This brings free where/find_by hash-condition normalization, makes validations see normalized values, and removes the silent self-heal of legacy rows on save (use record.normalize_attribute(:col) to migrate). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sanitizesmacro on top of Rails 7.1'sActiveRecord::Base.normalizes. The DSL is byte-for-byte identical, but normalization now runs at attribute assignment time instead ofbefore_save, which gives freewhere/find_byhash-condition normalization and lets validations see normalized values.record.normalize_attribute(:col)to migrate) in CHANGELOG and README, and adds 10 new specs covering assignment-time semantics, query normalization, the legacy-row migration path, idempotency, nil handling, in-place mutation, and validation timing.CLAUDE.mdwith project guidance (commands, architecture, changelog workflow).Test plan
bundle exec rspecpasses (13 examples, 0 failures)bundle exec appraisal rspecpasses on Rails 7.1, 7.2, and 8.0🤖 Generated with Claude Code