У меня есть три модели:
class Course < ApplicationRecord has_many :sections end class Section < ApplicationRecord belongs_to :course has_many :section_files end class SectionFile < ApplicationRecord belongs_to :section end
Всякий раз, когда я пытаюсь позвонить @course.sections, я получаю сообщение об ошибке undefined method 'relation_delegate_class' for Course::Section:Module
@course.sections
undefined method 'relation_delegate_class' for Course::Section:Module
Есть идеи?
Исправлено указание имени класса в разделе
Class Course < ApplicationRecord has_many :sections, class_name: "::Section" end
Хотя @section.section_files, кажется, работает без явного указания имени класса
@section.section_files