Impressionist gem error: aggregates must have exactly one argument (Rails)

191 Views Asked by At

I have error in my app:

SQLite3::SQLException: DISTINCT aggregates must have exactly one argument: SELECT DISTINCT COUNT(DISTINCT ) FROM "impressions" WHERE "impressions"."impressionable_id" = ? AND "impressions"."impressionable_type" = ?.

What Can I do?

My model product.rb has:

is_impressionable :counter_cache => true, :column_name => :viewed_count, :uniq => true

My controller

class ProductsController < ApplicationController
  impressionist actions: [:show]

  def show
    ...
    impressionist(@product, nil, { unique: [:session_hash]})
  end

end

My view has:

= @product.impressionist_count(:filter=>:ip_address)
1

There are 1 best solutions below

2
On BEST ANSWER

Do you use squeel which causes similar issue in impressionist? Please check your gem versions to be up to date.