标签: ruby-on-rails
我有一个具有以下关联的模型:
class Car < ActiveRecord::Base belongs_to :transportation_vehicle belongs_to :owner has_many :parts def scrap(buyer, part) ... end end
如何在废料方法中访问所有者和零件?
答案 0 :(得分:1)
owner或self.owner。
owner
self.owner