ActiveAdmin - Where子句中的未知列 - has_many through

时间:2013-10-17 14:32:58

标签: mysql ruby-on-rails ruby activeadmin

我正在将ActiveAdmin应用到我的应用程序中。

在用户模型上,我有以下几种:

has_many :payments, :through => :ownerships, :source => :payment
has_many :subscription_payments, :through => :ownerships, :source => :payment, :conditions => "ownerships.buyable_type = 'Subscription'"

只要我将User添加到ActiveAdmin,我就会收到以下错误:

Mysql2::Error: Unknown column 'ownerships.buyable_type' in 'where clause': SELECT `payments`.* FROM `payments`  WHERE (ownerships.buyable_type = 'Subscription')

有什么想法吗?我坚持这个。

0 个答案:

没有答案