aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/active_record_callbacks.md
Commit message (Collapse)AuthorAgeFilesLines
* Remove reminiscences from previous documentation [ci skip]Alberto Almagro2019-04-231-8/+0
| | | | | | | | | | | | | 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.
* Add documentation for 'after_save_commit' [ci skip]Sharang Dashputre2019-04-051-2/+25
|
* update callbacks skipping methods in guide [ci skip]Shivam Jain2019-02-231-3/+2
|
* Revert "Merge pull request #35324 from sharang-d/patch-2"Ryuta Kamizono2019-02-191-1/+1
| | | | | | | | | | | 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]
* Update active_record_callbacks.md [ci skip]Sharang Dashputre2019-02-191-1/+1
| | | | Change 'happen' to a more technical term
* Delete documentation inconsistency 'finally' for AR callbacks [ci skip] ↵Shodai Suzuki2019-02-191-1/+1
| | | | (#35303)
* Add combining callback conditions [skip ci] (#35313)Shodai Suzuki2019-02-191-0/+14
|
* Clarify transactional behavior of after_commit and after_rollback callbacksRobbert Brak2018-09-141-1/+3
|
* Improve documentation of Procs as :if / :unless options for callbacksFabian Schwahn2018-08-201-0/+8
|
* Rails guides are now served over httpsPaul McMahon2018-07-241-1/+1
| | | | | http links will be redirected to the https version, but still better to just directly link to the https version.
* Fix document issue in active record callback about `after_touch` hook.lanzhiheng2018-07-151-4/+4
|
* Added a lot of Oxford commasAnthony Crumley2018-05-101-1/+1
| | | | | | | [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) "
* Deprecate update_attributes and update_attributes!Eddie Lebow2018-02-171-1/+1
| | | | Closes #31998
* Move touch method from Skipping Callbacks section to Running Callbacks ↵Avneet Singh Malhotra2017-11-131-1/+1
| | | | section [ci skip]
* Small grammar fixesJon Moss2017-08-161-1/+1
| | | | | | Changed sentence to be more clear [ci skip]
* [ci skip] Add documentation for after_create_commit and after_update_commit ↵jagdeepsingh2017-07-251-0/+29
| | | | callbacks
* Pluralize callbackJon Moss2017-04-101-1/+3
| | | | | | Users could have more than one `before_destroy` callback in their models. [ci skip]
* Merge pull request #28680 from vishalzambre/callback_doc_updateJon Moss2017-04-101-0/+2
|\ | | | | Documented issue related before_destroy with dependent: :destroy
| * [ci skip] documented issue related before_destroyvishalzambre2017-04-101-0/+2
| | | | | | | | Updated text
* | Fix edge guides for Active Record callbacksAlessandro Dal Grande2017-04-041-1/+5
|/
* Remove deprecate passing string to `:if` and `:unless` conditional options ↵yuuji.yaginuma2017-02-181-11/+1
| | | | | | [ci skip] Follow up to #27608
* Merge pull request #25427 from eugeneius/update_increment_documentationKasper Timm Hansen2017-01-081-2/+0
|\ | | | | Update increment! documentation [ci skip]
| * Update increment! documentation [ci skip]Eugene Kenny2016-08-151-2/+0
| | | | | | | | | | | | | | | | | | | | | | 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.
* | Abuse of protected in guidesAkira Matsuda2016-12-251-3/+3
| |
* | Update docs for change in transaction callback exceptionsNathan Wenneker2016-09-031-1/+1
|/ | | | | | | | | 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]
* [skip ci] Fix typo and simplify after_commit examplewynksaiddestroy2016-06-141-2/+2
| | | | 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.
* Mention that halting chain does not re-raise `ActiveRecord::RecordInvalid` ↵Vipul A M2016-01-191-1/+1
| | | | | | | | exception as well, similar to `ActiveRecord::Rollback` Fixes #22297 [ci skip]
* Introduce ApplicationRecord, an Active Record layer supertypeGenadi Samokovarov2015-12-161-17/+17
| | | | | | | | | | | | | | | | 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.
* Introduce after_{create,update,delete}_commit callbacksGenadi Samokovarov2015-12-061-0/+19
| | | | | | | | | | | | | | | | 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
* Merge pull request #19289 from ahmad-alkheat/masterYves Senn2015-03-111-1/+1
|\ | | | | Unnecessary usage of self in the guides [ci skip]
| * Unnecessary usage of self in the guidesAhmad Al-kheat2015-03-111-1/+1
| | | | | | 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 markdown renderer conditionVipul A M2015-01-141-1/+1
|/ | | | - Changed `IN` to `ON` in all note sentences in guides.
* warn about reading guides in GitHubXavier Noria2014-12-231-0/+2
| | | | References #18148.
* correct markdown usage [ci skip]Nishant Modak2014-07-091-1/+1
|
* Rename Posts to Articles in Guides, continuation of 2d446e77 / #13774 [ci skip]John Kelly Ferguson2014-05-211-8/+8
|
* Add after_commit/after_rollback to callback listKyle Heironimus2014-04-101-0/+3
| | | | | | 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
* Merge pull request #13032 from kuldeepaggarwal/after_touch_documentationYves Senn2013-12-121-0/+49
|\ | | | | [ci skip] added after_touch callback documentation [ci skip]
| * [ci skip] added after_touch callback documentationKuldeep Aggarwal2013-12-121-0/+49
| | | | | | | | [ci skip] added more explanation for `after_touch` callback
* | typos rectified lifecycle => life cycleAayush khandelwal2013-12-121-1/+1
| |
* | The section that mentions after_commit and after_rollback will swallow ↵Bikram2013-11-281-1/+1
|/ | | | exceptions should me made clear. Made that section to be a instead of a regular paragraph.
* Merge branch 'master' of github.com:rails/docrailsVijay Dev2013-11-071-2/+2
|\
| * exists? is deprecated in ruby trunk [ci skip]Rashmi Yadav2013-11-011-2/+2
| | | | | | see here 4d4ff531b8807ee88a3fc46875c7e76f613956fb
* | Rephrase ActiveRecord transaction rollback warningNate Berkopec2013-10-161-1/+1
|/ | | | [ci skip]
* Use Ruby on Rails Coding Conventions for code examples in the guidesPaul Nikitochkin2013-09-061-10/+10
| | | | | | | | * 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]
* Change the wording to explain following methods skip callbacks [ci skip]Prathamesh Sonpatki2013-08-191-1/+3
|
* Remove block argument from callback example.Carlos Souza2013-07-131-2/+2
| | | | [ci skip]
* 1.9 Hash SyntaxAkira Matsuda2013-07-081-1/+1
|
* Adding find_by in guide to methods that trigger after_findCristian Planas2013-07-011-0/+1
|
* update the example for `after_commit` in the guides.Yves Senn2013-02-241-9/+7
| | | | This is a follow up to #9356.
* remove 'update' duplicationsJuanjo Bazán2013-01-081-1/+0
|