Skip to content

Commit e2207c7

Browse files
Use h4 headings in AR::Associations method docs [ci-skip]
SDoc uses `h3` headings for method signatures, so to preserve heading hierarchy, method documentation should use `h4`, `h5`, or `h6`. (cherry picked from commit 3c38fe5)
1 parent abb2491 commit e2207c7

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

activerecord/lib/active_record/associations.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ module ClassMethods
13001300
# Returns a Relation of all of the associated objects, forcing a database read.
13011301
# An empty Relation is returned if none are found.
13021302
#
1303-
# === Example
1303+
# ==== Example
13041304
#
13051305
# A <tt>Firm</tt> class declares <tt>has_many :clients</tt>, which will add:
13061306
# * <tt>Firm#clients</tt> (similar to <tt>Client.where(firm_id: id)</tt>)
@@ -1321,7 +1321,7 @@ module ClassMethods
13211321
# * <tt>Firm#clients.reload</tt>
13221322
# The declaration can also include an +options+ hash to specialize the behavior of the association.
13231323
#
1324-
# === Scopes
1324+
# ==== Scopes
13251325
#
13261326
# You can pass a second argument +scope+ as a callable (i.e. proc or
13271327
# lambda) to retrieve a specific set of records or customize the generated
@@ -1332,7 +1332,7 @@ module ClassMethods
13321332
# has_many :employees, -> { joins(:address) }
13331333
# has_many :posts, ->(blog) { where("max_post_length > ?", blog.max_post_length) }
13341334
#
1335-
# === Extensions
1335+
# ==== Extensions
13361336
#
13371337
# The +extension+ argument allows you to pass a block into a has_many
13381338
# association. This is useful for adding new finders, creators, and other
@@ -1346,7 +1346,7 @@ module ClassMethods
13461346
# end
13471347
# end
13481348
#
1349-
# === Options
1349+
# ==== Options
13501350
# [+:class_name+]
13511351
# Specify the class name of the association. Use it only if that name can't be inferred
13521352
# from the association name. So <tt>has_many :products</tt> will by default be linked
@@ -1501,7 +1501,7 @@ def has_many(name, scope = nil, **options, &extension)
15011501
# [<tt>reload_association</tt>]
15021502
# Returns the associated object, forcing a database read.
15031503
#
1504-
# === Example
1504+
# ==== Example
15051505
#
15061506
# An Account class declares <tt>has_one :beneficiary</tt>, which will add:
15071507
# * <tt>Account#beneficiary</tt> (similar to <tt>Beneficiary.where(account_id: id).first</tt>)
@@ -1511,7 +1511,7 @@ def has_many(name, scope = nil, **options, &extension)
15111511
# * <tt>Account#create_beneficiary!</tt> (similar to <tt>b = Beneficiary.new(account_id: id); b.save!; b</tt>)
15121512
# * <tt>Account#reload_beneficiary</tt>
15131513
#
1514-
# === Scopes
1514+
# ==== Scopes
15151515
#
15161516
# You can pass a second argument +scope+ as a callable (i.e. proc or
15171517
# lambda) to retrieve a specific record or customize the generated query
@@ -1522,7 +1522,7 @@ def has_many(name, scope = nil, **options, &extension)
15221522
# has_one :employer, -> { joins(:company) }
15231523
# has_one :latest_post, ->(blog) { where("created_at > ?", blog.enabled_at) }
15241524
#
1525-
# === Options
1525+
# ==== Options
15261526
#
15271527
# The declaration can also include an +options+ hash to specialize the behavior of the association.
15281528
#
@@ -1674,7 +1674,7 @@ def has_one(name, scope = nil, **options)
16741674
# [<tt>association_previously_changed?</tt>]
16751675
# Returns true if the previous save updated the association to reference a new associate object.
16761676
#
1677-
# === Example
1677+
# ==== Example
16781678
#
16791679
# A Post class declares <tt>belongs_to :author</tt>, which will add:
16801680
# * <tt>Post#author</tt> (similar to <tt>Author.find(author_id)</tt>)
@@ -1687,7 +1687,7 @@ def has_one(name, scope = nil, **options)
16871687
# * <tt>Post#author_previously_changed?</tt>
16881688
# The declaration can also include an +options+ hash to specialize the behavior of the association.
16891689
#
1690-
# === Scopes
1690+
# ==== Scopes
16911691
#
16921692
# You can pass a second argument +scope+ as a callable (i.e. proc or
16931693
# lambda) to retrieve a specific record or customize the generated query
@@ -1698,7 +1698,7 @@ def has_one(name, scope = nil, **options)
16981698
# belongs_to :user, -> { joins(:friends) }
16991699
# belongs_to :level, ->(game) { where("game_level > ?", game.current_level) }
17001700
#
1701-
# === Options
1701+
# ==== Options
17021702
#
17031703
# [+:class_name+]
17041704
# Specify the class name of the association. Use it only if that name can't be inferred
@@ -1877,7 +1877,7 @@ def belongs_to(name, scope = nil, **options)
18771877
# Returns a Relation of all of the associated objects, forcing a database read.
18781878
# An empty Relation is returned if none are found.
18791879
#
1880-
# === Example
1880+
# ==== Example
18811881
#
18821882
# A Developer class declares <tt>has_and_belongs_to_many :projects</tt>, which will add:
18831883
# * <tt>Developer#projects</tt>
@@ -1897,7 +1897,7 @@ def belongs_to(name, scope = nil, **options)
18971897
# * <tt>Developer#projects.reload</tt>
18981898
# The declaration may include an +options+ hash to specialize the behavior of the association.
18991899
#
1900-
# === Scopes
1900+
# ==== Scopes
19011901
#
19021902
# You can pass a second argument +scope+ as a callable (i.e. proc or
19031903
# lambda) to retrieve a specific set of records or customize the generated
@@ -1909,7 +1909,7 @@ def belongs_to(name, scope = nil, **options)
19091909
# where("default_category = ?", post.default_category)
19101910
# }
19111911
#
1912-
# === Extensions
1912+
# ==== Extensions
19131913
#
19141914
# The +extension+ argument allows you to pass a block into a
19151915
# has_and_belongs_to_many association. This is useful for adding new
@@ -1924,7 +1924,7 @@ def belongs_to(name, scope = nil, **options)
19241924
# end
19251925
# end
19261926
#
1927-
# === Options
1927+
# ==== Options
19281928
#
19291929
# [+:class_name+]
19301930
# Specify the class name of the association. Use it only if that name can't be inferred

0 commit comments

Comments
 (0)