| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
its section
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
(#35612)
* Add example for has_many :through source/source_type
* Add example for has_one :through source/source_type
|
|
|
|
| |
Add a note explaining when the has_many associations callbacks will be called or not.
|
|
|
|
| |
supports it.
|
|
|
|
|
|
| |
(#28078)
This PR addresses the issue described in #28025. On `dependent: :nullify` strategy only the foreign key of the relation is nullified. However on polymorphic associations the `*_type` column is not nullified leaving the record with a NULL `*_id` but the `*_type` column is present.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
| |
|
|
|
|
|
| |
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.
|
|
|
|
| |
Follow up #32146.
|
|\
| |
| |
| |
| | |
Remove index:true option from belongs to as defaults to true.
[ci skip]
|
| | |
|
| |
| |
| |
| |
| | |
Line items are a holdover from when orders were used in the examples
instead of books.
|
| |
| |
| |
| |
| | |
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) "
|
| |
| |
| |
| | |
over 5.0 ver of rails
|
| | |
|
| | |
|
| |
| |
| |
| | |
Updated the method counts and unified them all on numerals.
|
|\ \
| | |
| | |
| | | |
Fix :inverse_of documentation
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
options, and is needed for bi-directionality with a scope
[ci skip] Remove :conditions opion from association basics guide
This got replaced by scopes.
|
|/
|
|
|
|
| |
- Make all `ActiveRecord::Base.find` as link
- Remove redundant sentences
"It also adds the additional condition that the object must be in the collection."
|
| |
|
|\
| |
| | |
Fix indentation [ci skip]
|
| | |
|
|\ \
| |/
|/| |
[ci skip]Revert commits changing wrong place
|
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
passing `unique` parameter to belongs_to not right,
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Because I can never remember if `collection_singular_ids=` persists
or not (it does).
[ci skip]
|
|
|
| |
Passing `true` to the association has been deprecated.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
- We no longer add `null: false` for timestamps columns as per
rails/rails@a939506.
- Followup of
https://github.com/rails/docrails/commit/14867b1a9af813b0147bba2ae06675137d61d77b.
|
| |
|
| |
|
|
|
|
| |
- Followup of https://github.com/rails/rails/commit/71ff088a09d429657877ddfb58985d30df63fc8a
|