mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Tiny documentation edits [ci skip]
This commit is contained in:
parent
948424d556
commit
803ef74f9b
3 changed files with 4 additions and 5 deletions
|
@ -1019,7 +1019,7 @@ module ActiveRecord
|
|||
# can affect what it does.
|
||||
#
|
||||
# Note that <tt>:dependent</tt> option is ignored for +has_one+ <tt>:through</tt> associations.
|
||||
#
|
||||
#
|
||||
# === Delete or destroy?
|
||||
#
|
||||
# +has_many+ and +has_and_belongs_to_many+ associations have the methods <tt>destroy</tt>,
|
||||
|
@ -1529,8 +1529,6 @@ module ActiveRecord
|
|||
# NOTE: <tt>required</tt> is set to <tt>true</tt> by default and is deprecated. If
|
||||
# you don't want to have association presence validated, use <tt>optional: true</tt>.
|
||||
#
|
||||
#
|
||||
#
|
||||
# Option examples:
|
||||
# belongs_to :firm, foreign_key: "client_of"
|
||||
# belongs_to :person, primary_key: "name", foreign_key: "person_name"
|
||||
|
|
|
@ -770,7 +770,7 @@ module ActiveRecord
|
|||
# # Check a foreign key exists
|
||||
# foreign_key_exists?(:accounts, :branches)
|
||||
#
|
||||
# # Check a foreign key on specified column exists
|
||||
# # Check a foreign key on a specified column exists
|
||||
# foreign_key_exists?(:accounts, column: :owner_id)
|
||||
#
|
||||
# # Check a foreign key with a custom name exists
|
||||
|
|
|
@ -959,7 +959,8 @@ If you set the `:validate` option to `true`, then associated objects will be val
|
|||
|
||||
##### `:optional`
|
||||
|
||||
If you set the `:optional` option to `true`, then associated object will be validated for presence. By default, this is `false`: associated objects will be validated for presence.
|
||||
If you set the `:optional` option to `true`, then the presence of the associated
|
||||
object won't be validated. By default, this option is set to `false`.
|
||||
|
||||
#### Scopes for `belongs_to`
|
||||
|
||||
|
|
Loading…
Reference in a new issue