Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attributes.mass_assignment_strict_mode #32

Merged
merged 3 commits into from
Nov 4, 2024
Merged

Attributes.mass_assignment_strict_mode #32

merged 3 commits into from
Nov 4, 2024

Conversation

paneq
Copy link
Contributor

@paneq paneq commented Nov 1, 2024

Implements mass_assignment_strict_mode

The setting is per class and configures strict handling of unknown attributes by raising an exception, just like Rails/ActiveModel does.

By default it is disabled, and you need to opt-in.

This is valuable for cases where Granite is used in combination with GQL mutations and there is no risk of using incorrect attributes or getting some accidental junk from web forms.

paneq added 2 commits November 1, 2024 12:44
The setting is per class and configures strict handling of unknown attributes
by raising an exception, just like Rails/ActiveModel does.

By default it is disabled, and you need to opt-in.

This is valuable for cases where Granite is used in combination with GQL
defined mutations and there is no risk of using incorrect attributes or
getting some accidental junk from web forms.
@paneq paneq self-assigned this Nov 1, 2024
@paneq paneq merged commit 33606cc into master Nov 4, 2024
5 checks passed
@paneq paneq deleted the strict-attributes branch November 4, 2024 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants