impressionist icon indicating copy to clipboard operation
impressionist copied to clipboard

Super simple setup with impressionist, mismatch between impressionist_count and impressions_count.

Open sergiotapia opened this issue 9 years ago • 1 comments

Using Rails 4 and Impressionist 1.5.1


I have a ProductsController and a Product model.

In my show action:

def show
  impressionist(@product, "unique view", :unique => [:session_hash])
end

In my model:

class Product < ActiveRecord::Base
  is_impressionable counter_cache: true
end 

And my Product schema:

create_table "products", force: true do |t|
  t.string   "name",                                        null: false
  t.integer  "impressions_count",           default: 0
end

And there's a mismatch between the counts:

irb(main):001:0> Product.find_by(slug: 'test').impressions_count
=> 57
irb(main):002:0> Product.find_by(slug: 'test').impressionist_count
=> 70

sergiotapia avatar Apr 17 '15 19:04 sergiotapia

Lol this is still open? :laughing:

sergiotapia avatar Sep 23 '15 16:09 sergiotapia