aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/type.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-21 21:47:53 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-21 21:47:53 -0300
commit2fb2913b35c4a706f0207119ab0b3e89f61546a1 (patch)
tree2a1a4df21243f9db901520f22ece415a40045601 /activerecord/lib/active_record/connection_adapters/type.rb
parent62bcf81431baf84f7e4c370c1ae30fe07ee1022a (diff)
parente45e4f44e35d6ce9868542cc2a151b2a6c497e9b (diff)
downloadrails-2fb2913b35c4a706f0207119ab0b3e89f61546a1.tar.gz
rails-2fb2913b35c4a706f0207119ab0b3e89f61546a1.tar.bz2
rails-2fb2913b35c4a706f0207119ab0b3e89f61546a1.zip
Merge pull request #15237 from sgrif/sg-move-extract-scale
Move extract_scale to decimal type
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/type.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/type.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/type.rb b/activerecord/lib/active_record/connection_adapters/type.rb
index 763176cb2b..9103ae85c0 100644
--- a/activerecord/lib/active_record/connection_adapters/type.rb
+++ b/activerecord/lib/active_record/connection_adapters/type.rb
@@ -22,8 +22,8 @@ module ActiveRecord
class << self
def extract_scale(sql_type)
case sql_type
- when /^(numeric|decimal|number)\((\d+)\)/i then 0
- when /^(numeric|decimal|number)\((\d+)(,(\d+))\)/i then $4.to_i
+ when /\((\d+)\)/ then 0
+ when /\((\d+)(,(\d+))\)/ then $3.to_i
end
end
end