diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-05-13 06:21:36 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-05-13 06:21:36 -0600 |
commit | ec779ad50176748eef716bdd7b2ca99e807038ae (patch) | |
tree | c3c14f988951dc13d1b644e01ade21ae1c892c7a | |
parent | f7881d3e2b87016c6788ceceda4c849ae7a0a009 (diff) | |
parent | ddbf097cae7b49e4c464d749266d0d0a71dd9ae2 (diff) | |
download | rails-ec779ad50176748eef716bdd7b2ca99e807038ae.tar.gz rails-ec779ad50176748eef716bdd7b2ca99e807038ae.tar.bz2 rails-ec779ad50176748eef716bdd7b2ca99e807038ae.zip |
Merge pull request #20121 from matthewrudy/remove-sanitize-hash
Remove call to sanitize_sql_hash_for_conditions
-rw-r--r-- | activerecord/lib/active_record/sanitization.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/sanitization.rb b/activerecord/lib/active_record/sanitization.rb index c7f55ebaa1..c2567311bd 100644 --- a/activerecord/lib/active_record/sanitization.rb +++ b/activerecord/lib/active_record/sanitization.rb @@ -11,17 +11,15 @@ module ActiveRecord protected - # Accepts an array, hash, or string of SQL conditions and sanitizes + # Accepts an array or string of SQL conditions and sanitizes # them into a valid SQL fragment for a WHERE clause. # ["name='%s' and group_id='%s'", "foo'bar", 4] returns "name='foo''bar' and group_id='4'" - # { name: "foo'bar", group_id: 4 } returns "name='foo''bar' and group_id='4'" # "name='foo''bar' and group_id='4'" returns "name='foo''bar' and group_id='4'" def sanitize_sql_for_conditions(condition, table_name = self.table_name) return nil if condition.blank? case condition when Array; sanitize_sql_array(condition) - when Hash; sanitize_sql_hash_for_conditions(condition, table_name) else condition end end |