Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Can't get it to log unique impressions #105
Despite the performance problems discussed in my other issue here:
I will give impressionist a try again in a new project. However, there are some problems.
I can't get impressionist to keep unique impressions in the counter cache.
I have this in my controller:
Still, it logs a new impression in my counter cache (called
I'm using Rails 4 and impressionist 1.4.5
Something seems really off here...
If I run:
I get the same result with
The SQL generated looks like this:
I guess there should be a DISTINCT thrown in there as well to make it work.
Impressionist seems to call something like this:
This doesn't seem to work. At least not in Rails 4. How about doing something like this instead:
This works in Rails 4 but the
So, perhaps just check rails version and keep the current solution if < 4.0 otherwise go with the above?