Access Active Record Object Attributes in Rails Model
I have a model with the following associations:
class Car < ActiveRecord::Base
开发者_开发技巧 belongs_to :transportation_vehicle
belongs_to :owner
has_many :parts
def scrap(buyer, part)
...
end
end
How would I access owner and parts in the scrap method?
owner
or self.owner
.
精彩评论