| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
guides/source/getting_started.md
|
| | |
|
|/ |
|
| |
|
|\ |
|
| | |
|
|/
|
|
|
|
|
|
|
|
| |
The other way it was not marking the text as italic, it was showing the
underlines as normal text.
Also fixes some code examples indentation and # => marks in Active Model
and Active Record guides.
[ci skip]
|
|
Two big features that are only barely related in the same guide. Seems
bad.
I did not check references to these guides yet, so some links may need
to be updated.
|