Skip to content

Bypass accessor on increment/decrement #52701

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

Closed

Conversation

grimmdude
Copy link

@grimmdude grimmdude commented Sep 8, 2024

When incrementing/decrementing database values using increment()/decrement() it isn't desirable to execute an accessor that may exist on the column, as it's not really being "accessed".

The intention with this PR is to bypass any accessors to avoid unintended side effects.

#52694

(replaces previous PR #52697)

@rodrigopedra
Copy link
Contributor

it isn't desirable to execute an accessor that may exist on the column, as it's not really being "accessed".

How is it not being accessed?

If one is reading an attribute's value to produce a new value, then it is being accessed.

Also, if one defines an attribute, that reads/writes to a JSON string stored in a DB's column, it would be mandatory to read from the accessor before incrementing.

@taylorotwell
Copy link
Member

I am closing this pull request because it lacks sufficient explanation, tests, or both. It is difficult for us to merge pull requests without these things because the change may introduce breaking changes to the framework.

Feel free to re-submit your change with a thorough explanation of the feature and tests - integration tests are preferred over unit tests. Please include it's benefit to end users; the reasons it does not break any existing features; how it makes building web applications easier, etc.

Thanks!

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