Hi,
I am trying to find all terms and courses that apply to a contact.
Here are my models
class Register < ActiveRecord::Base
belongs_to :session
belongs_to :contact
end
class Session < ActiveRecord::Base
belongs_to :term
belongs_to :course
has_many :registers
has_many :contacts, :through => :registers
end
Here is the find a wrote
@data = Register.all :joins => {:session =>[:term, :course]} , :conditions => ["contact_id = ?", params[:id]]
When I run the query all I get is the session records not the terms or courses
Thanks
Alex