diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2018-02-09 16:32:35 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2018-02-14 13:10:08 -0500 |
commit | d2d98d69468bf34a39794496beb8f9f7b69088c4 (patch) | |
tree | 1712b44eb7082efabc7dedeb8e7058c3de9bc8bf /activejob/test | |
parent | b098584f63521d214c1107e6eaa24f292b8e4df8 (diff) | |
download | rails-d2d98d69468bf34a39794496beb8f9f7b69088c4.tar.gz rails-d2d98d69468bf34a39794496beb8f9f7b69088c4.tar.bz2 rails-d2d98d69468bf34a39794496beb8f9f7b69088c4.zip |
Allow serializers to be used either as classes or objects
Diffstat (limited to 'activejob/test')
-rw-r--r-- | activejob/test/cases/serializers_test.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/activejob/test/cases/serializers_test.rb b/activejob/test/cases/serializers_test.rb index fb0e6ecae6..207ae55b49 100644 --- a/activejob/test/cases/serializers_test.rb +++ b/activejob/test/cases/serializers_test.rb @@ -17,21 +17,19 @@ class SerializersTest < ActiveSupport::TestCase end class DummySerializer < ActiveJob::Serializers::ObjectSerializer - class << self - def serialize(object) - super({ "value" => object.value }) - end + def serialize(object) + super({ "value" => object.value }) + end - def deserialize(hash) - DummyValueObject.new(hash["value"]) - end + def deserialize(hash) + DummyValueObject.new(hash["value"]) + end - private + private def klass DummyValueObject end - end end setup do |