0

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)
myf
  • 185
  • 1
  • 3
  • 11

1 Answers1

1

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

Artem
  • 823
  • 8
  • 14
  • I have checked. I use: gem 'impressionist', '~> 1.5', '>= 1.5.1' and gem 'squeel', github: 'activerecord-hackery/squeel'. – myf Dec 24 '15 at 20:22
  • 1
    The fix is still not merged to original repo, but you can try to install from godfat's one: `gem 'impressionist', github: 'godfat/impressionist', branch: 'compatible-with-squeel'` – Artem Dec 25 '15 at 01:48