diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-21 21:47:53 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-21 21:47:53 -0300 |
commit | 2fb2913b35c4a706f0207119ab0b3e89f61546a1 (patch) | |
tree | 2a1a4df21243f9db901520f22ece415a40045601 /activerecord/lib/active_record/connection_adapters/type | |
parent | 62bcf81431baf84f7e4c370c1ae30fe07ee1022a (diff) | |
parent | e45e4f44e35d6ce9868542cc2a151b2a6c497e9b (diff) | |
download | rails-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')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/type/decimal.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/type/value.rb | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/type/decimal.rb b/activerecord/lib/active_record/connection_adapters/type/decimal.rb index ac5af4b963..a8cd1cf5b5 100644 --- a/activerecord/lib/active_record/connection_adapters/type/decimal.rb +++ b/activerecord/lib/active_record/connection_adapters/type/decimal.rb @@ -4,6 +4,8 @@ module ActiveRecord class Decimal < Value # :nodoc: include Numeric + delegate :extract_scale, to: Type + def type :decimal end diff --git a/activerecord/lib/active_record/connection_adapters/type/value.rb b/activerecord/lib/active_record/connection_adapters/type/value.rb index 289c27f6d4..52d9ed9bc0 100644 --- a/activerecord/lib/active_record/connection_adapters/type/value.rb +++ b/activerecord/lib/active_record/connection_adapters/type/value.rb @@ -3,10 +3,7 @@ module ActiveRecord module Type class Value # :nodoc: def type; end - - def extract_scale(sql_type) - Type.extract_scale(sql_type) - end + def extract_scale(sql_type); end def type_cast(value) cast_value(value) unless value.nil? |