impressionist icon indicating copy to clipboard operation
impressionist copied to clipboard

Using counter_cache without params[:id]

Open franktisellano opened this issue 10 years ago • 2 comments

One of the models in my app uses a uuid in its show route instead of an id, so when I enable counter_cache, nothing happens. Are there any workarounds for this kind of setup?

franktisellano avatar May 03 '15 21:05 franktisellano

@franktisellano - see URL below

https://github.com/charlotte-ruby/impressionist/wiki/Impressionist-and-vanity-URLs-(working-with-models-that-use-to_param)

CiaranPearse avatar Jun 08 '16 15:06 CiaranPearse

I also ran into same issue.

If all of the relevant models use uuid as an id, changing type of impressions.impressionable_id and impressions.user_id to uuid works for me.

Above link seems unrelated.

yskkin avatar Dec 06 '18 04:12 yskkin