阅读背景:

如何按照其他数据的数量顺序列出日期?

来源:互联网 
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



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: