I have found the following line of code in our app:
class ClientSerializer
include JSONAPI::Serializer
...
has_one :credit_card_unsaved, serializer: :credit_card, &:credit_card_unsaved
end
This as the effect of calling the INSTANCE method credit_card_unsaved, and serializing it properly with the CreditCardSerializer. This is the exact functionality that we need since we don't want actual rails associations for some of the data we want to serialize.
However this syntax does not seem to be documented anywhere. I would love for this to be explained to me. Is this expected behavior? If this is part of the api, then could you please document it? I would like to have some confidence that this behavior is expected and expected to keep working indefinitely.
Thanks!
I have found the following line of code in our app:
This as the effect of calling the INSTANCE method credit_card_unsaved, and serializing it properly with the CreditCardSerializer. This is the exact functionality that we need since we don't want actual rails associations for some of the data we want to serialize.
However this syntax does not seem to be documented anywhere. I would love for this to be explained to me. Is this expected behavior? If this is part of the api, then could you please document it? I would like to have some confidence that this behavior is expected and expected to keep working indefinitely.
Thanks!