diff options
author | Guo Xiang Tan <tgx_world@hotmail.com> | 2019-05-03 22:24:52 +0800 |
---|---|---|
committer | Guo Xiang Tan <tgx_world@hotmail.com> | 2019-05-03 22:36:23 +0800 |
commit | 25f1e0e3ea78538fce3025dab3e5f8a48dd6fc2b (patch) | |
tree | 55203921214f4f2b53eb18cae159c51ab810435c | |
parent | 9b0e632def6a66bbd0c0aba8531b2a173f7c3064 (diff) | |
download | rails-25f1e0e3ea78538fce3025dab3e5f8a48dd6fc2b.tar.gz rails-25f1e0e3ea78538fce3025dab3e5f8a48dd6fc2b.tar.bz2 rails-25f1e0e3ea78538fce3025dab3e5f8a48dd6fc2b.zip |
Recover perf for `pluck` by reverting 9c9c950d02af83742a5f76302d0faa99508f242c.
This reverts commit 9c9c950d02af83742a5f76302d0faa99508f242c.
-rw-r--r-- | activemodel/lib/active_model/type/integer.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/type/integer.rb b/activemodel/lib/active_model/type/integer.rb index 1e1061ff60..e9bbdf4b7b 100644 --- a/activemodel/lib/active_model/type/integer.rb +++ b/activemodel/lib/active_model/type/integer.rb @@ -18,6 +18,11 @@ module ActiveModel :integer end + def deserialize(value) + return if value.blank? + value.to_i + end + def serialize(value) return if value.is_a?(::String) && non_numeric_string?(value) ensure_in_range(super) |