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