class Subject < ActiveRecord::Base
attr_accessible :name, :teacher_id
has_and_belongs_to_many :courses
belongs_to :teacher
has_many :users, :through =>:feedback
has_many :feedbacks
end
class Course < ActiveRecord::Base
attr_accessible :name
has_many :users
has_and_belongs_to_many :subjects
validates :name, presence: true, length: { maximum: 50 }
end
class Feedback < ActiveRecord::Base
attr_accessible :rating, :recommendations, :strengths, :subject_id, :user_id, :weaknesses
belongs_to :user
belongs_to :subject
end
class User < ActiveRecord::Base
attr_accessible :course_id, :email, :gender, :name, :password, :password_confirmation
has_secure_password
belongs_to :course
has_many :feedbacks
has_many :subjects, :through =>:feedback
end
class Subject < ActiveRecord::Base
attr_acces