aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/association_basics.md
Commit message (Collapse)AuthorAgeFilesLines
* fix typo on association_basics.md [ci skip]Espartaco Palma2018-11-141-1/+1
|
* Describe how has_many's :dependent option affects #deleteMarcel M. Cary2018-11-131-0/+2
| | | | | | | | | | | | | | | | | | I was puzzled about why `collection=` was destroying the removed records on an association with `dependent: :destroy`, even after consulting the documentation for that option. I had to dive into the Active Record source to understand what was going on: eventually `collection=` calls `collection.delete` on the ousted records, and it also uses the `:dependent` option to decide how to remove records. It would have helped me to have mention of this in the documentation for `:dependent`, not just under `collection.delete` (which I found much later). Briefly mention the broader impacts of `:dependent` in the Association Basics guide. [ci skip]
* Document exception from restrict_with_exception [ci skip]Malcolm Locke2018-10-291-2/+2
|
* [ci skip] Fix #33914Raghu Kamat2018-10-221-3/+2
| | | | | This commit removes the dependent: :destroy option from the belong_to example since there is a warning associated with the usage of dependent: :destroy along with belongs_to. Based on the feedback on the issue #33914, I replaced dependent: :destroy with touch: :books_updated_at which will make the example consistent with the example that already exists on that page. * Also Removing the touch option from the belong_to scopes example as the option doesnt have any relation to association scope.
* Remove and flip `index: true` for `references` in the doc [ci skip]Ryuta Kamizono2018-10-171-1/+1
| | | | Follow up #32146.
* Merge pull request #32146 from abhikanojia/association_guide_fixRyuta Kamizono2018-10-171-10/+10
|\ | | | | | | | | Remove index:true option from belongs to as defaults to true. [ci skip]
| * Remove index:true option from belongs to as defaults to true.abhishekkanojia2018-03-011-10/+10
| |
* | Replace line items with chapters [ci skip]Ian Fleeton2018-09-211-13/+13
| | | | | | | | | | Line items are a holdover from when orders were used in the examples instead of books.
* | 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.
* | [ci skip] fix typo in Associations guideK. Rodman Mannix2018-07-221-1/+1
| |
* | Add situation for belongs to association. [ci skip]lanzhiheng2018-07-181-1/+1
| |
* | Added a lot of Oxford commasAnthony Crumley2018-05-101-2/+2
| | | | | | | | | | | | | | [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) "
* | [ci skip] belongs_to in self join association needs optional: true, if it's ↵nao0515ki2018-04-141-1/+1
| | | | | | | | over 5.0 ver of rails
* | Put images into each page's dir in guidesYoshiyuki Hirano2018-03-311-7/+7
| |
* | Fix example migrations in Associations guideRyan Lue2018-01-261-17/+9
| |
* | Fix minor typo [ci skip]Tom Copeland2018-01-181-4/+4
| | | | | | | | Updated the method counts and unified them all on numerals.
* | Merge pull request #31446 from bdewater/inverse-of-options-docsRyuta Kamizono2018-01-111-14/+5
|\ \ | | | | | | | | | Fix :inverse_of documentation
| * | [ci skip] setting :inverse_of works with :as, :through and :polymorphic ↵Bart de Water2018-01-101-17/+9
|/ / | | | | | | | | | | | | | | options, and is needed for bi-directionality with a scope [ci skip] Remove :conditions opion from association basics guide This got replaced by scopes.
* / Update "Active Record Associations" guide [ci skip]bogdanvlviv2017-12-141-3/+5
|/ | | | | | - Make all `ActiveRecord::Base.find` as link - Remove redundant sentences "It also adds the additional condition that the object must be in the collection."
* Update Rails Guides about :autosave optionAnton Chumakov2017-09-201-4/+4
|
* Merge pull request #30394 from ydakuka/fixing-indentationRyuta Kamizono2017-08-241-6/+6
|\ | | | | Fix indentation [ci skip]
| * Fix indentation [ci skip]Yauheni Dakuka2017-08-241-6/+6
| |
* | Merge pull request #30376 from willnet/belongs-to-dependent-optionRyuta Kamizono2017-08-241-6/+5
|\ \ | |/ |/| [ci skip]Revert commits changing wrong place
| * [ci skip]Revert commits changing wrong placewillnet2017-08-241-6/+5
| | | | | | | | | | | | This reverts commits 5147ab121d628f29451c654a8c312d5a3f491ffb and 391043ab04007bfd4c4c4c8e8d3308c1eae60175. These commits looked to intend to change documents of has_many dependent options, but actually changed documents of belongs_to dependent options.
* | add missing collection.reload documentation [ci skip]Julia López2017-08-081-2/+24
| |
* | add reload_association to documentation [ci skip]Julia López2017-08-071-4/+6
|/
* [ci skip] Add backquote to :counter_cache optionYohei Yasukawa2017-06-101-1/+1
|
* remove the extra comma in association_basics.mdYauheni Dakuka2017-06-091-1/+1
|
* [ci skip]fix wrong variable name in docsMakoto Nihei2017-05-251-1/+1
|
* [ci skip]fix wrong method name in docswillnet2017-05-241-2/+2
|
* Improve foreign key description in guides [ci skip]Krzysztof Maicher2017-03-061-2/+18
|
* passing unique parameter to belongs_to wrongly0oneo2017-03-031-1/+1
| | | passing `unique` parameter to belongs_to not right,
* Clarify Bi-directional Associations docsDavid Sherline2017-01-031-23/+41
| | | | | | | | | | | Rails automatically finds bi-directional associations between models with well-named associations. However, when using non-standard naming, you have to use :inverse_of to explicitly tell Rails about the bi- directional association. With reference to #27516 [ci skip]
* Update HABTM documentation in guidesJames Doyley2016-10-261-3/+1
|
* [ci skip] Simply formatting documentsNeodelf2016-09-061-5/+5
|
* Grammar fix [ci skip]Waitaya Krongapiradee2016-09-021-1/+1
|
* Docs: Clarify when assoc. methods persistJared Beck2016-05-261-4/+4
| | | | | | | Because I can never remember if `collection_singular_ids=` persists or not (it does). [ci skip]
* Update how to clear the association cacheSammy Larbi2016-03-281-2/+2
| | | Passing `true` to the association has been deprecated.
* Clarify has_many :dependent option docs [ci skip]Chris Arcand2016-03-111-9/+7
| | | | | | Clarifies the documentation here to mean all options are for when the relation is destroyed; also now reflects the documentation on this same option found in the has_one section.
* [ci skip] Update all guides with `null: false` change in migrationsPrathamesh Sonpatki2016-03-031-19/+19
| | | | | | | - We no longer add `null: false` for timestamps columns as per rails/rails@a939506. - Followup of https://github.com/rails/docrails/commit/14867b1a9af813b0147bba2ae06675137d61d77b.
* [ci skip] fix typosMikhail Dieterle2016-02-141-3/+3
|
* [ci skip] fix typoMikhail Dieterle2016-01-301-1/+1
|
* Fix discrepancies in associations guide [ci skip]Prathamesh Sonpatki2016-01-191-6/+6
| | | | - Followup of https://github.com/rails/rails/commit/71ff088a09d429657877ddfb58985d30df63fc8a
* `ApplicationRecord` instead of `ActiveRecord::Base` in Association Guides ↵amitkumarsuroliya2016-01-191-2/+2
| | | | [ci skip]
* Association Guide replaces Order as example with Author-Book Example [ci skip]amitkumarsuroliya2016-01-181-230/+230
| | | fixes #21500
* Merge pull request #22394 from j-dexx/update_association_basics_guideJon Moss2016-01-181-3/+13
|\ | | | | Updated the guides for having a distinct has_many through at the data…
| * Updated the guides for having a distinct has_many through at the database levelJames Doyley2016-01-181-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current example add_index :person_articles, :article, unique: true Does not work, the `:article` column does not exist as it will be a join table (based on the prior example) so should use :article_id The documentation seems to suggest that it will allow an article to be added only once to a person via the join table, what actually occurs is that it only allows the article to be added to one person, at which point it should be a `belongs_to` association. Also changed the new example to use readings based on the prior example
* | ApplicationRecord documentation passGenadi Samokovarov2015-12-171-117/+117
| | | | | | | | | | | | | | This is a pass over the documentation which fills the missing gaps of `ApplicationRecord`. [ci skip]
* | Use a real migration version number in docsMatthew Draper2015-12-151-13/+13
| | | | | | | | | | Even though this means more things to change when we bump after a release, it's more important that our examples are directly copyable.
* | Use a deliberately-invalid migration version in all doc examplesMatthew Draper2015-12-151-13/+13
|/ | | | | | | | | | If we use a real version, at best that'll be an onerous update required for each release; at worst, it will encourage users to write new migrations against an older version than they're using. The other option would be to leave these bare, without any version specifier. But as that's just a variant spelling of "4.2", it would seem to raise the same concerns as above.