rails-api/active_model_serializers — pull request #170 by MattRogish (2012-12-11 01:05:02+00:00)
Title: Support optional types for computed attributes

We're using Serializer.schema to auto-generate our Ember.js schema. We added a method that returns a string, but AMS is sending 'nil' since it's computed, which messes up the schema. This PR allows you to specify an optional type for a computed attribute so that your schema matches what you expect.