Skip to content

Add attributes.values to Default cache_fragment_name #28

Description

@benhutton What would you think about adding attributes.values to the default implementation of https://github.com/desiringgod/components-rails/blob/master/lib/components/rails/caching.rb#L26-L32`?

We're seeing a number of components where the #cache_key implementation is just attributes.values. Though there could be a case where a Component would not change based on an attribute provided and we wouldn't want the cache_fragment_name to change, that seems like an edge case and not a good reason to not implement this.

Also, if we do this, I think we could get away with not requiring #cache_key to be implemented. If #cache_key is implemented, it would effectively get added to this value.

Thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions