aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2018-02-12 14:16:41 -0500
committerRafael Mendonça França <rafaelmfranca@gmail.com>2018-02-14 13:10:08 -0500
commit69645cba727dfa1c18c666d2a2f1c0dedffde938 (patch)
treedc5fda6749d63a795d12459a8dc2d8994c5bfea6 /guides
parent71721dc1c9b769d3c06317122dc88cad4a346580 (diff)
downloadrails-69645cba727dfa1c18c666d2a2f1c0dedffde938.tar.gz
rails-69645cba727dfa1c18c666d2a2f1c0dedffde938.tar.bz2
rails-69645cba727dfa1c18c666d2a2f1c0dedffde938.zip
Simplify the implementation of custom argument serializers
We can speed up things for the supported types by keeping the code in the way it was. We can also avoid to loop trough all serializers in the deserialization by trying to access the class already in the Hash. We could also speed up the custom serialization if we define the class that is going to be serialized when registering the serializers, but that will remove the possibility of defining a serialzer for a superclass and have the subclass serialized using it.
Diffstat (limited to 'guides')
-rw-r--r--guides/source/active_job_basics.md6
1 files changed, 0 insertions, 6 deletions
diff --git a/guides/source/active_job_basics.md b/guides/source/active_job_basics.md
index 0ee522e23d..92a04c585f 100644
--- a/guides/source/active_job_basics.md
+++ b/guides/source/active_job_basics.md
@@ -404,12 +404,6 @@ class MoneySerializer < ActiveJob::Serializers::ObjectSerializer
)
end
- # Check if this serialized value be deserialized using this serializer.
- # ActiveJob::Serializers::ObjectSerializer#deserialize? already take care of this.
- def deserialize?(argument)
- super
- end
-
# Convert serialized value into a proper object
def deserialize(hash)
Money.new hash["cents"], hash["currency"]