我有:
class Student < ActiveRecord::Base
#attr_accessible :lastname, :name
has_many :together
has_many :teachers, :through => :together
end
class Teacher < ActiveRecord::Base
#attr_accessible :lastname, :name
has_many :together
has_many :students, :through => :together
end
class Together < ActiveRecord::Base
#attr_accessible :summary
belongs_to :student
belongs_to :teacher
end
我想做类似的事情:
Student.find(1).together.summary
我想访问联接表中“摘要”列中的数据...