Skip to content

Commit

Permalink
Display invalid value in error (#44255)
Browse files Browse the repository at this point in the history
* Display invalid value in error

* Update activerecord/lib/active_record/core.rb

Co-authored-by: Rafael Mendonça França <rafael@franca.dev>
  • Loading branch information
justin808 and rafaelfranca committed Jan 27, 2022
1 parent 436a307 commit efae65d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/core.rb
Expand Up @@ -657,7 +657,7 @@ def strict_loading?
# => #<ActiveRecord::Associations::CollectionProxy>
def strict_loading!(value = true, mode: :all)
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

@strict_loading_mode = mode
Expand Down

0 comments on commit efae65d

Please sign in to comment.