Skip to content

Conversation

@alyssais
Copy link

resource_for_model passes the model instance, so resources can vary based on model instance.
Caching them based on model class, therefore, can wrongly use a resource that for a record that should use a different resource.

I just ran into this when choosing resource based on the type of a polymorphic relationship.

resource_for_model passes the model instance, so resources can vary
based on model instance. Therefore, caching based on the model class can
cause incorrect resources to be used.
@lgebhardt lgebhardt merged commit a5fef38 into cerebris:master Jul 21, 2016
@lgebhardt
Copy link
Member

@penman Thanks!

@alyssais alyssais deleted the resources_for branch July 21, 2016 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants