尝试销毁活动记录实例时,我遇到了一个问题.
它涉及以下AR
class Client < ActiveRecord::Base has_many :phone_numbers,:dependent => :destroy has_many :email_addresses,:dependent => :destroy has_many :user_clients,:dependent => :destroy has_many :users,:through => :user_clients end class UserClient < ActiveRecord::Base belongs_to :user belongs_to :client,:dependent => :destroy has_many :instructions,:dependent => :destroy end
在客户端实例上执行销毁时,我发出以下错误
@dead_man = Client.find(params[:id]) @dead_man.destroy => uninitialized constant UserClient::Instruction
我真的不知道这个错误来自哪里.任何帮助是极大的赞赏!