From d2d98d69468bf34a39794496beb8f9f7b69088c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 9 Feb 2018 16:32:35 -0500 Subject: Allow serializers to be used either as classes or objects --- activejob/test/cases/serializers_test.rb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'activejob/test/cases') 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 -- cgit v1.2.3