diff options
-rw-r--r-- | activemodel/lib/active_model/type/integer.rb | 5 | ||||
-rw-r--r-- | activemodel/test/cases/type/integer_test.rb | 2 | ||||
-rw-r--r-- | activestorage/lib/active_storage.rb | 1 |
3 files changed, 2 insertions, 6 deletions
diff --git a/activemodel/lib/active_model/type/integer.rb b/activemodel/lib/active_model/type/integer.rb index 5878b94171..1ff232a977 100644 --- a/activemodel/lib/active_model/type/integer.rb +++ b/activemodel/lib/active_model/type/integer.rb @@ -18,11 +18,6 @@ module ActiveModel :integer end - def deserialize(value) - return if value.nil? - value.to_i - end - def serialize(value) result = super if result diff --git a/activemodel/test/cases/type/integer_test.rb b/activemodel/test/cases/type/integer_test.rb index 9bd0110099..dec188b4cc 100644 --- a/activemodel/test/cases/type/integer_test.rb +++ b/activemodel/test/cases/type/integer_test.rb @@ -54,7 +54,7 @@ module ActiveModel type = Type::Integer.new assert_nil type.cast("") assert_nil type.serialize("") - assert_equal 0, type.deserialize("") + assert_nil type.deserialize("") end test "changed?" do diff --git a/activestorage/lib/active_storage.rb b/activestorage/lib/active_storage.rb index e542c4b2ca..5c5da551ae 100644 --- a/activestorage/lib/active_storage.rb +++ b/activestorage/lib/active_storage.rb @@ -26,6 +26,7 @@ require "active_record" require "active_support" require "active_support/rails" +require "active_support/core_ext/numeric/time" require "active_storage/version" require "active_storage/errors" |