Open
Conversation
Override #freeze in Attributes to initialize and freeze @attributes, ensuring that any attempt to write to a frozen model naturally raises FrozenError (RuntimeError on Ruby < 2.5) via the frozen Hash. Add frozen_error_class test helper in spec/support for Ruby version compatibility. Write tests covering write_attribute, []=, reads, inspect, apply_defaults (unit), and assign_attributes/attributes= across the MassAssignment + Attributes boundary (functional). https://claude.ai/code/session_01MPZp1QECyJ3vnRxgStE1p8
- Define frozen_error_class in FrozenErrorHelper module, configured via RSpec config.include rather than as a bare Kernel method - Move generated attribute setter frozen test to attributes_spec.rb where it belongs (Attributes defines the method) - Remove Attributes method tests from MassAssignment functional spec; MassAssignment frozen context now only tests assign_attributes and attributes= https://claude.ai/code/session_01MPZp1QECyJ3vnRxgStE1p8
- Version bumped to 0.18.0 (behavior change: frozen models now raise) - CHANGELOG entry added as Unreleased - Removed YARD doc from #freeze; it overrides a built-in and needs no separate documentation https://claude.ai/code/session_01MPZp1QECyJ3vnRxgStE1p8
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.
Override #freeze in Attributes to initialize and freeze @attributes,
ensuring that any attempt to write to a frozen model naturally raises
FrozenError (RuntimeError on Ruby < 2.5) via the frozen Hash.
Add frozen_error_class test helper in spec/support for Ruby version
compatibility. Write tests covering write_attribute, []=, reads,
inspect, apply_defaults (unit), and assign_attributes/attributes=
across the MassAssignment + Attributes boundary (functional).
https://claude.ai/code/session_01MPZp1QECyJ3vnRxgStE1p8