| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
In #35861 documentation for `after_save_commit` was added, but also old
documentation was adapted. I think adapting the old documentation is not
necessary because there are already examples for `after_commit` on
`:destroy` above. On top of that the action invoked by the callback on
`:destroy` (`:log_user_saved_to_db`) talks about saving when the object
is destroyed, which can be misleading.
As I believe the documentation added by #35861 is already enough this
patch removes the modified part, which made sense before adding docs for
`after_save_commit` but is already covered by other parts of this guide.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 6b69ae5149f03c2f81a795c085bce56ec18535ae, reversing
changes made to 84bd9adafde36d0192849649b86ffcd4e59e5e11.
Reason: We already use "happen" a lots for callbacks and validations.
https://github.com/rails/rails/pull/35324#issuecomment-465096483
[ci skip]
|
|
|
|
| |
Change 'happen' to a more technical term
|
|
|
|
| |
(#35303)
|
| |
|
| |
|
| |
|
|
|
|
|
| |
http links will be redirected to the https version, but still better to
just directly link to the https version.
|
| |
|
|
|
|
|
|
|
| |
[ci skip] A regular expression was used to find a lot of missing Oxford
commas and add them. The regular expression was as follows.
", ([a-zA-Z0-9.\`:'\"]+ ){1,6}(or|and) "
|
|
|
|
| |
Closes #31998
|
|
|
|
| |
section [ci skip]
|
|
|
|
|
|
| |
Changed sentence to be more clear
[ci skip]
|
|
|
|
| |
callbacks
|
|
|
|
|
|
| |
Users could have more than one `before_destroy` callback in their models.
[ci skip]
|
|\
| |
| | |
Documented issue related before_destroy with dependent: :destroy
|
| |
| |
| |
| | |
Updated text
|
|/ |
|
|
|
|
|
|
| |
[ci skip]
Follow up to #27608
|
|\
| |
| | |
Update increment! documentation [ci skip]
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The `increment!` and `decrement!` methods were recently reimplemented to
make them safe to call from multiple connections concurrently. This
changed their behaviour in a few ways.
Previously they used `update_attribute`, which calls the attribute
setter method, runs callbacks, and touches the record. Now they behave
more like `update_column`, writing the update to the database directly
and bypassing all of those steps.
|
| | |
|
|/
|
|
|
|
|
|
|
| |
07d3d40 changed how exceptions are handled in after_commit
and after_destroy callbacks. This commit updates the 5.0
release notes and the ActiveRecord callback guide to reflect
the new behavior.
[ci skip]
|
|
|
|
| |
The beginning of the note on the :on option is not capitalised correctly.
The :destroy symbol in the after_commit example is unnecessarily wrapped in an array.
|
|
|
|
|
|
|
|
| |
exception as well, similar to `ActiveRecord::Rollback`
Fixes #22297
[ci skip]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's pretty common for folks to monkey patch `ActiveRecord::Base` to
work around an issue or introduce extra functionality. Instead of
shoving even more stuff in `ActiveRecord::Base`, `ApplicationRecord` can
hold all those custom work the apps may need.
Now, we don't wanna encourage all of the application models to inherit
from `ActiveRecord::Base`, but we can encourage all the models that do,
to inherit from `ApplicationRecord`.
Newly generated applications have `app/models/application_record.rb`
present by default. The model generators are smart enough to recognize
that newly generated models have to inherit from `ApplicationRecord`,
but only if it's present.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Those are actually shortcuts for `after_commit`.
Before:
after_commit :add_to_index_later, on: :create
after_commit :update_in_index_later, on: :update
after_commit :remove_from_index_later, on: :destroy
After:
after_create_commit :add_to_index_later
after_update_commit :update_in_index_later
after_destroy_commit :remove_from_index_later
|
|\
| |
| | |
Unnecessary usage of self in the guides [ci skip]
|
| |
| |
| | |
I deleted self from the callbacks guides code example because it's unnecessary and this way it's more like the other examples where self was not used.
|
|/
|
|
| |
- Changed `IN` to `ON` in all note sentences in guides.
|
|
|
|
| |
References #18148.
|
| |
|
| |
|
|
|
|
|
|
| |
Adding after_commit/after_rollback to list of callbacks in order helps
explain the callback order as well as making it consistent with the API
docs at http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html
|
|\
| |
| | |
[ci skip] added after_touch callback documentation [ci skip]
|
| |
| |
| |
| | |
[ci skip] added more explanation for `after_touch` callback
|
| | |
|
|/
|
|
| |
exceptions should me made clear. Made that section to be a instead of a regular paragraph.
|
|\ |
|
| |
| |
| | |
see here 4d4ff531b8807ee88a3fc46875c7e76f613956fb
|
|/
|
|
| |
[ci skip]
|
|
|
|
|
|
|
|
| |
* Indent after private/protected
* Ruby >= 1.9 syntax for hashes
* Prefer method { do_stuff } instead of method{do_stuff} for single-line blocks.
[ci skip]
|
| |
|
|
|
|
| |
[ci skip]
|
| |
|
| |
|
|
|
|
| |
This is a follow up to #9356.
|
| |
|