标签: ruby-on-rails activerecord
鉴于以下型号......
class Parent < ActiveRecord::Base has_many :children end class Child < ActiveRecord::Base belongs_to :parent end
并给出以下疑问......
child = Child.first parent = child.parent
是否可以在child的实例方法中获取对parent的引用?
child
parent