| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
(#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
|
|
|
|
| |
[ci skip]
|
|
|
| |
fixes #21500
|
|\
| |
| | |
Updated the guides for having a distinct has_many through at the data…
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| | |
This is a pass over the documentation which fills the missing gaps of
`ApplicationRecord`.
[ci skip]
|
| |
| |
| |
| |
| | |
Even though this means more things to change when we bump after a
release, it's more important that our examples are directly copyable.
|