Skip to content

Conversation

byroot
Copy link
Member

@byroot byroot commented Dec 15, 2024

Fix: #26420

Back in Rails 4, calling #increment! on a new record would save it, but I don't think it's a good behavior, and it no longer has done so for many years now.

It's better to raise like #update_columns.

Fix: rails#26420

Back in Rails 4, calling `#increment!` on a new record would save
it, but I don't think it's a good behavior, and it no longer
has done so for many years now.

It's better to raise like `#update_columns`.

Co-Authored-By: akicho8 <akicho8@gmail.com>
@byroot byroot merged commit 8e7627a into rails:main Dec 15, 2024
3 checks passed
@byroot byroot deleted the increment-raise-new-record branch December 15, 2024 15:07
matthewd added a commit to matthewd/rails that referenced this pull request Jan 28, 2025
…w-record"

This reverts commit 8e7627a, reversing
changes made to bec587e.
matthewd added a commit to matthewd/rails that referenced this pull request Feb 11, 2025
…w-record"

This reverts commit 8e7627a, reversing
changes made to bec587e.
matthewd added a commit to matthewd/rails that referenced this pull request Mar 20, 2025
…w-record"

This reverts commit 8e7627a, reversing
changes made to bec587e.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

increment! method behavior differ Rails4 and Rails5
1 participant