aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2015-10-16 09:25:39 -0700
committerSean Griffin <sean@seantheprogrammer.com>2015-10-16 09:25:39 -0700
commitcd4575f98c11bfa698c0c7b6a3e1feae64006a76 (patch)
tree4131033fa034e039075c73bfa80d1115a11ea2fe /activerecord/lib
parentb3656076d64fabb7a492aa4b8e8d45b6826b8798 (diff)
parent7663376f0708118694874c2670f0053c4143bc3f (diff)
downloadrails-cd4575f98c11bfa698c0c7b6a3e1feae64006a76.tar.gz
rails-cd4575f98c11bfa698c0c7b6a3e1feae64006a76.tar.bz2
rails-cd4575f98c11bfa698c0c7b6a3e1feae64006a76.zip
Merge pull request #21944 from jwworth/issue-20473
where raises ArgumentError on unsupported argument types
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index 55fd0e0b52..0dcecbd42d 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -552,6 +552,8 @@ module ActiveRecord
WhereChain.new(spawn)
elsif opts.blank?
self
+ elsif !opts.is_a?(String) && !opts.respond_to?(:to_h)
+ raise ArgumentError, "Unsupported argument type: #{opts} (#{opts.class})"
else
spawn.where!(opts, *rest)
end