mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Display invalid value in error (#44255)
* Display invalid value in error * Update activerecord/lib/active_record/core.rb Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
This commit is contained in:
parent
436a307cd6
commit
efae65d005
1 changed files with 1 additions and 1 deletions
|
@ -657,7 +657,7 @@ module ActiveRecord
|
||||||
# => #<ActiveRecord::Associations::CollectionProxy>
|
# => #<ActiveRecord::Associations::CollectionProxy>
|
||||||
def strict_loading!(value = true, mode: :all)
|
def strict_loading!(value = true, mode: :all)
|
||||||
unless [:all, :n_plus_one_only].include?(mode)
|
unless [:all, :n_plus_one_only].include?(mode)
|
||||||
raise ArgumentError, "The :mode option must be one of [:all, :n_plus_one_only]."
|
raise ArgumentError, "The :mode option must be one of [:all, :n_plus_one_only] but #{mode.inspect} was provided."
|
||||||
end
|
end
|
||||||
|
|
||||||
@strict_loading_mode = mode
|
@strict_loading_mode = mode
|
||||||
|
|
Loading…
Reference in a new issue