diff options
author | Kir Shatrov <shatrov@me.com> | 2017-07-01 23:09:13 +0300 |
---|---|---|
committer | Kir Shatrov <shatrov@me.com> | 2017-07-06 21:30:43 +0300 |
commit | b3f3d49fd6b91c6573b3e10e3d00f65306638927 (patch) | |
tree | b831a180c5fe686fc47d80f56e46f2e727fac1b5 /activerecord/lib/active_record/connection_adapters | |
parent | 6f2b0eb44ab166f98f3bc4a3aa09d3b899e0fd62 (diff) | |
download | rails-b3f3d49fd6b91c6573b3e10e3d00f65306638927.tar.gz rails-b3f3d49fd6b91c6573b3e10e3d00f65306638927.tar.bz2 rails-b3f3d49fd6b91c6573b3e10e3d00f65306638927.zip |
Prepare AP and AR to be frozen string friendly
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/oid/money.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid/money.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid/money.rb index 7a91272d1c..cd7442e751 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/oid/money.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/money.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module ActiveRecord module ConnectionAdapters module PostgreSQL @@ -22,7 +23,7 @@ module ActiveRecord # (3) -$2.55 # (4) ($2.55) - value.sub!(/^\((.+)\)$/, '-\1') # (4) + value = value.sub(/^\((.+)\)$/, '-\1') # (4) case value when /^-?\D+[\d,]+\.\d{2}$/ # (1) value.gsub!(/[^-\d.]/, "") |