aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-06-09 23:33:38 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-06-09 23:33:38 -0300
commitd5d3d3d6585330ae10fa892b2cde6e8ac90d5156 (patch)
treea4aa860d0ddefcc070f9923e6a8ad0d91f4be31c /activerecord
parent3d949f34816d6eca0a6b59cfa08d91f36e8e64dd (diff)
parentc70aee8eea066d911410f40974a3ee9d387cd834 (diff)
downloadrails-d5d3d3d6585330ae10fa892b2cde6e8ac90d5156.tar.gz
rails-d5d3d3d6585330ae10fa892b2cde6e8ac90d5156.tar.bz2
rails-d5d3d3d6585330ae10fa892b2cde6e8ac90d5156.zip
Merge pull request #20500 from repinel/use-block-not-global-var
Another use block variable instead of global
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/sanitization.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/sanitization.rb b/activerecord/lib/active_record/sanitization.rb
index c2567311bd..ba75ffa5a1 100644
--- a/activerecord/lib/active_record/sanitization.rb
+++ b/activerecord/lib/active_record/sanitization.rb
@@ -119,9 +119,9 @@ module ActiveRecord
end
def replace_named_bind_variables(statement, bind_vars) #:nodoc:
- statement.gsub(/(:?):([a-zA-Z]\w*)/) do
+ statement.gsub(/(:?):([a-zA-Z]\w*)/) do |match|
if $1 == ':' # skip postgresql casts
- $& # return the whole match
+ match # return the whole match
elsif bind_vars.include?(match = $2.to_sym)
replace_bind_variable(bind_vars[match])
else