Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is it possible to have 2 types of counter_cache for the same model? #273

Open
nuriel opened this issue Dec 11, 2018 · 0 comments
Open

is it possible to have 2 types of counter_cache for the same model? #273

nuriel opened this issue Dec 11, 2018 · 0 comments

Comments

@nuriel
Copy link

nuriel commented Dec 11, 2018

First of all, thank you so much for this gem, it looks great and the documentation is crystal clear.

My question -
We have a Video model which we want to track 2 types of impressions for - views and downloads
I'm using the impressionist method with the message param to differentiate between them:
impressionist(@video, 'view', unique: [: ip_address, :message])
impressionist(@video, 'download', unique: [: ip_address, :message])

Is there a way to manage two different cached fields for this model, where each one updates by the type of event?

Thanks again!

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

No branches or pull requests

1 participant