aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/type/numeric.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/type/numeric.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/type/numeric.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/type/numeric.rb b/activerecord/lib/active_record/connection_adapters/type/numeric.rb
index a3379831cb..15081daf8d 100644
--- a/activerecord/lib/active_record/connection_adapters/type/numeric.rb
+++ b/activerecord/lib/active_record/connection_adapters/type/numeric.rb
@@ -14,6 +14,10 @@ module ActiveRecord
else super
end
end
+
+ def extract_precision(sql_type)
+ $1.to_i if sql_type =~ /\((\d+)(,\d+)?\)/
+ end
end
end
end