我的应用程序有错误:
SQLite3::SQLException: DISTINCT 聚合必须只有一个参数:SELECT DISTINCT COUNT(DISTINCT) FROM "impressions" WHERE "impressions"."impressionable_id" = ? 和“印象数”。“impressionable_type”=?。
我能做些什么?
我的模型product.rb 有:
is_impressionable :counter_cache => true, :column_name => :viewed_count, :uniq => true
我的控制器
class ProductsController < ApplicationController
impressionist actions: [:show]
def show
...
impressionist(@product, nil, { unique: [:session_hash]})
end
end
我的观点是:
= @product.impressionist_count(:filter=>:ip_address)