diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-05-21 09:51:36 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-05-21 09:51:36 +0200 |
commit | 1a92f4fb6574100fb9d16cf3f8e395c3a58938d6 (patch) | |
tree | a270d7c75f6fad7cc56275f2fc91591c4bf5cb19 /activerecord/lib/active_record/connection_adapters/type/value.rb | |
parent | 6b4f6d00642d16079e5bafe487fd27ee3ff1d1fb (diff) | |
download | rails-1a92f4fb6574100fb9d16cf3f8e395c3a58938d6.tar.gz rails-1a92f4fb6574100fb9d16cf3f8e395c3a58938d6.tar.bz2 rails-1a92f4fb6574100fb9d16cf3f8e395c3a58938d6.zip |
push `extract_scale` to the `Type`.
- `extract_precision`, `extract_limit`, and `extract_default` probably need to follow.
- would be good to remove the delegation `Column#extract_scale`.
/cc @sgrif
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/type/value.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/type/value.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/type/value.rb b/activerecord/lib/active_record/connection_adapters/type/value.rb index 577e464553..289c27f6d4 100644 --- a/activerecord/lib/active_record/connection_adapters/type/value.rb +++ b/activerecord/lib/active_record/connection_adapters/type/value.rb @@ -4,6 +4,10 @@ module ActiveRecord class Value # :nodoc: def type; end + def extract_scale(sql_type) + Type.extract_scale(sql_type) + end + def type_cast(value) cast_value(value) unless value.nil? end |