aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/column.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-22 15:47:46 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-22 15:47:46 -0300
commit3b814ed2b52305797451149dbb629b601a18165f (patch)
tree5bbcf2fab4697ad63d90ab65a3a7efa19b1a31dd /activerecord/lib/active_record/connection_adapters/column.rb
parent35c160066aea1f0ded952da0f3f9e78b61c38507 (diff)
parent55400052186c3b3cb15c86f38ee266e5dafed696 (diff)
downloadrails-3b814ed2b52305797451149dbb629b601a18165f.tar.gz
rails-3b814ed2b52305797451149dbb629b601a18165f.tar.bz2
rails-3b814ed2b52305797451149dbb629b601a18165f.zip
Merge pull request #15239 from croaky/dc-sg-move-extract-precision-to-types
Move `extract_precision` onto type objects
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/column.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/column.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb
index a718756b93..522fa57822 100644
--- a/activerecord/lib/active_record/connection_adapters/column.rb
+++ b/activerecord/lib/active_record/connection_adapters/column.rb
@@ -69,15 +69,11 @@ module ActiveRecord
end
private
- delegate :extract_scale, to: :cast_type
+ delegate :extract_scale, :extract_precision, to: :cast_type
def extract_limit(sql_type)
$1.to_i if sql_type =~ /\((.*)\)/
end
-
- def extract_precision(sql_type)
- $2.to_i if sql_type =~ /^(numeric|decimal|number)\((\d+)(,\d+)?\)/i
- end
end
end
# :startdoc: