对不起,主题中的“奇怪”,这就是正在发生的事情。
我有一个看起来像这样的 ActiveRecord 对象:
class BraintreeCache < ActiveRecord::Base
belongs_to :company, :foreign_key => :subscription_id
serialize :subscription
serialize :credit_card
end
执行:
BraintreeCache.delete(:subscription_id => "12")
将返回:
ActiveRecord::StatementInvalid: PGError: ERROR: missing FROM-clause entry for table "id"
LINE 1: DELETE FROM "braintree_caches" WHERE "id"."subscription_id" ...
^
: DELETE FROM "braintree_caches" WHERE "id"."subscription_id" = '12'
这里发生了什么?“身份证”从何而来?
谢谢,