A simple polymorphic relationship like:
class Api::V1::TagResource < BaseResource belongs_to taggable, polymorphic: true end
and a call like /api/v1/tags/1?include=taggable
will fail on any of the .joins(:ar_hash) i.e.
https://github.com/cerebris/jsonapi-resources/blob/master/lib/jsonapi/resource.rb#L1143
with the message:
Can not eagerly load the polymorphic association :taggable
Any ideas on how to avoid this. It seems like trying to not cache the polymorphic relations for now might be the best approach. However, this code appears to get hit regardless of if a resource is marked as cached or not. Which means that for simpler relations caching can not be enabled if any requests involve a poly. Any help would be appreciated. Thank you.
A simple polymorphic relationship like:
class Api::V1::TagResource < BaseResource belongs_to taggable, polymorphic: true endand a call like /api/v1/tags/1?include=taggable
will fail on any of the .joins(:ar_hash) i.e.
https://github.com/cerebris/jsonapi-resources/blob/master/lib/jsonapi/resource.rb#L1143
with the message:
Can not eagerly load the polymorphic association :taggableAny ideas on how to avoid this. It seems like trying to not cache the polymorphic relations for now might be the best approach. However, this code appears to get hit regardless of if a resource is marked as cached or not. Which means that for simpler relations caching can not be enabled if any requests involve a poly. Any help would be appreciated. Thank you.