0
我收到錯誤「未初始化常量賦值:: AssignmentsCourse」。這裏是我的模型:Rails錯誤未初始化常量賦值:: AssignmentsCourse中有許多通過關聯
assignment.rb
class Assignment < ActiveRecord::Base
has_many :assignmentsCourses
has_many :courses, :through => :assignmentsCourses
attr_accessible :name, :dateAssigned, :dateDue, :description, :weight, :category_tokens
attr_reader :category_tokens
def category_tokens=(ids)
puts 'el ids: ', ids.split(",")
self.courseIds = ids.split(",")
end
end
course.rb
class Course < ActiveRecord::Base
has_and_belongs_to_many :assignments
end
AssignmentCourse.rb
class AssignmentCourse < ActiveRecord::Base
belongs_to :assignment
belongs_to :course
attr_accessible :assignment_id, :course_id
end