Tôi đang gặp sự cố khi cố hủy một bản ghi hoạt động.Đường ray: lỗi liên tục chưa được khởi tạo trên Bản ghi Hoạt động tiêu diệt
Nó bao gồm AR sau
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
Khi thực hiện phá hủy trên một trường hợp khách hàng tôi đưa ra các lỗi sau
@dead_man = Client.find(params[:id])
@dead_man.destroy => uninitialized constant UserClient::Instruction
Tôi thực sự không chắc chắn nơi lỗi này là đến từ. Bất kỳ trợ giúp nào cũng được đánh giá rất cao!