aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/query_methods.rb
diff options
context:
space:
mode:
authorSergey Alekseev <sergey.alekseev.minsk@gmail.com>2014-05-23 23:42:36 +0300
committerSergey Alekseev <sergey.alekseev.minsk@gmail.com>2014-05-23 23:53:00 +0300
commit1a4d13b8f429afe218eb98d8dbf82780e4f191e6 (patch)
treefcdd4c6d8e55a896267c4b242e661e754399ff36 /activerecord/lib/active_record/relation/query_methods.rb
parenta6f55fe257512731d7f3f41976648d99e9ec95be (diff)
downloadrails-1a4d13b8f429afe218eb98d8dbf82780e4f191e6.tar.gz
rails-1a4d13b8f429afe218eb98d8dbf82780e4f191e6.tar.bz2
rails-1a4d13b8f429afe218eb98d8dbf82780e4f191e6.zip
Remove duplicated parameter check on #where!
It seems that #where! is not designed to be used as a chained where. See initial implementation at 8c2c60511beaad05a218e73c4918ab89fb1804f0. So, no need to check twice. We should not test #where! https://github.com/rails/rails/pull/15285#discussion_r13018316
Diffstat (limited to 'activerecord/lib/active_record/relation/query_methods.rb')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index a607e9ac87..1262b2c291 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -573,15 +573,11 @@ WARNING
end
end
- def where!(opts = :chain, *rest) # :nodoc:
- if opts == :chain
- WhereChain.new(self)
- else
- references!(PredicateBuilder.references(opts)) if Hash === opts
+ def where!(opts, *rest) # :nodoc:
+ references!(PredicateBuilder.references(opts)) if Hash === opts
- self.where_values += build_where(opts, rest)
- self
- end
+ self.where_values += build_where(opts, rest)
+ self
end
# Allows you to change a previously set where condition for a given attribute, instead of appending to that condition.