Skip to content

Commit 2d18466

Browse files
Use comment for example errors [ci-skip]
1 parent 982f96d commit 2d18466

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

activerecord/lib/active_record/core.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -695,9 +695,9 @@ def strict_loading?
695695
# user = User.first
696696
# user.strict_loading! # => true
697697
# user.address.city
698-
# => ActiveRecord::StrictLoadingViolationError
698+
# # => ActiveRecord::StrictLoadingViolationError
699699
# user.comments.to_a
700-
# => ActiveRecord::StrictLoadingViolationError
700+
# # => ActiveRecord::StrictLoadingViolationError
701701
#
702702
# ==== Parameters
703703
#
@@ -717,7 +717,7 @@ def strict_loading?
717717
# user.address.city # => "Tatooine"
718718
# user.comments.to_a # => [#<Comment:0x00...]
719719
# user.comments.first.ratings.to_a
720-
# => ActiveRecord::StrictLoadingViolationError
720+
# # => ActiveRecord::StrictLoadingViolationError
721721
def strict_loading!(value = true, mode: :all)
722722
unless [:all, :n_plus_one_only].include?(mode)
723723
raise ArgumentError, "The :mode option must be one of [:all, :n_plus_one_only] but #{mode.inspect} was provided."

activerecord/lib/active_record/relation/query_methods.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ def null_relation? # :nodoc:
12991299
#
13001300
# users = User.readonly
13011301
# users.first.save
1302-
# => ActiveRecord::ReadOnlyRecord: User is marked as readonly
1302+
# # => ActiveRecord::ReadOnlyRecord: User is marked as readonly
13031303
#
13041304
# To make a readonly relation writable, pass +false+.
13051305
#
@@ -1320,7 +1320,7 @@ def readonly!(value = true) # :nodoc:
13201320
#
13211321
# user = User.strict_loading.first
13221322
# user.comments.to_a
1323-
# => ActiveRecord::StrictLoadingViolationError
1323+
# # => ActiveRecord::StrictLoadingViolationError
13241324
def strict_loading(value = true)
13251325
spawn.strict_loading!(value)
13261326
end

0 commit comments

Comments
 (0)