3
我正在使用active_admin和acts_As_taggable_on,我试图做一个过滤器。下面是型号代码:activeadmin和acts_as_taggable_on生成ambiguous_column_name错误
class Person < ApplicationRecord
acts_as_taggable_on :expertise, :industry
end
这里是过滤器:
filter :industry, as: :select, collection: Person.industry_counts.pluck(:name, :name)
,这里是错误提交过滤器时,我得到:
SQLite3::SQLException: ambiguous column name: created_at: SELECT COUNT(DISTINCT "people"."id") FROM "people" LEFT OUTER JOIN "taggings" ON "taggings"."taggable_id" = "people"."id" AND "taggings"."context" = ? AND "taggings"."taggable_type" = ? WHERE "taggings"."tag_id" = 0 AND (created_at > '2017-01-17 00:22:53.923894')
我该如何解决这个问题?
问题是'created_at>'2017-01-17 00:22:53.923894'' 'created_at'存在于'taggings'和'people'上 – TheRealMrCrowley
你可以发布代码的调用吗?似乎缺少某些东西 – TheRealMrCrowley