aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/query_methods.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-23 17:59:46 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-23 17:59:46 -0300
commit7abde1360b863f34900474ad70d1b41e50944ea3 (patch)
treeeece6c16d921f796d4f2874278f9f36e554c8d88 /activerecord/lib/active_record/relation/query_methods.rb
parent21f99b4be00e5cfa298a15732d054aaf2df00213 (diff)
parent1a4d13b8f429afe218eb98d8dbf82780e4f191e6 (diff)
downloadrails-7abde1360b863f34900474ad70d1b41e50944ea3.tar.gz
rails-7abde1360b863f34900474ad70d1b41e50944ea3.tar.bz2
rails-7abde1360b863f34900474ad70d1b41e50944ea3.zip
Merge pull request #15285 from sergey-alekseev/remove-active-record-where-duplicated-condition
Remove duplicated parameter check on #where!
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.