diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-10-17 19:40:10 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-10-17 19:40:10 -0300 |
commit | 6c36c369be0cdd8f5f5b47f77ba79d492db98f32 (patch) | |
tree | 256d06897322d66b5dd3390f28bb0be4717ccdc9 /activerecord/lib | |
parent | bae2292d8f32eb6e3c67a0ca57bd6053648d82c3 (diff) | |
download | rails-6c36c369be0cdd8f5f5b47f77ba79d492db98f32.tar.gz rails-6c36c369be0cdd8f5f5b47f77ba79d492db98f32.tar.bz2 rails-6c36c369be0cdd8f5f5b47f77ba79d492db98f32.zip |
Revert "Move the handling of supported arguments to `where`"
This reverts commit 4d8f62dcfa0a5157b3facbd71f75fc6639636347.
Reason: This broke the build. Please recommit again when it is green.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/where_clause_factory.rb | 2 |
2 files changed, 3 insertions, 1 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 diff --git a/activerecord/lib/active_record/relation/where_clause_factory.rb b/activerecord/lib/active_record/relation/where_clause_factory.rb index 9662756c2e..83ac074f97 100644 --- a/activerecord/lib/active_record/relation/where_clause_factory.rb +++ b/activerecord/lib/active_record/relation/where_clause_factory.rb @@ -21,7 +21,7 @@ module ActiveRecord parts = predicate_builder.build_from_hash(attributes) else - raise ArgumentError, "Unsupported argument type: #{opts} (#{opts.class})" + parts = [opts] end WhereClause.new(parts, binds) |