I am making my first app in Ruby on Rails 3.1....Do I have these relationships setup correctly? Essentially, a student/client will be able to login and rate a teacher. A client can have many teachers and a teacher can have many clients. Each client can create a rating for a particular teacher (a teacher can't rate clients). Ratings are optional.
I intend to be able to display a teacher's ratings from various clients and also allow clients to login and rate all the teachers they've had.
class Client < ActiveRecord::Base
has_many :ratings
has_and_belongs_to_many :teachers
end
class Teacher < ActiveRecord::Base
has_many :ratings
has_and_belongs_to_many :clients
end
class Rating < ActiveRecord::Base
belongs_to :teacher
belongs_to :client
end