File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -600,11 +600,6 @@ You can extend the list of supported argument types. You just need to define you
600
600
``` ruby
601
601
# app/serializers/money_serializer.rb
602
602
class MoneySerializer < ActiveJob ::Serializers ::ObjectSerializer
603
- # Checks if an argument should be serialized by this serializer.
604
- def serialize? (argument )
605
- argument.is_a? Money
606
- end
607
-
608
603
# Converts an object to a simpler representative using supported object types.
609
604
# The recommended representative is a Hash with a specific key. Keys can be of basic types only.
610
605
# You should call `super` to add the custom serializer type to the hash.
@@ -619,6 +614,12 @@ class MoneySerializer < ActiveJob::Serializers::ObjectSerializer
619
614
def deserialize (hash )
620
615
Money .new (hash[" amount" ], hash[" currency" ])
621
616
end
617
+
618
+ private
619
+ # Checks if an argument should be serialized by this serializer.
620
+ def klass
621
+ Money
622
+ end
622
623
end
623
624
```
624
625
You can’t perform that action at this time.
0 commit comments