Skip to content

breaks has_one :through #1

@KevinMonk

Description

@KevinMonk

This is my first time posting an issue on any open source project so apologies if it's not done in the usual format.

I have a model like this:

class GradeGrade < ActiveRecord::Base
belongs_to :grade_item, :foreign_key => :itemid
has_one :moodle_course, :through => :grade_item ### This is broken by nested has many
end

In the console I could do the following:
g = GradeGrade.find(26)
g.moodle_course

It works fine without this plugin installed and shows this:
Mysql::Error: Unknown column 'mdl_course.grade_grade_id' in 'where clause': SELECT mdl_course.* FROM mdl_course WHERE (mdl_course.grade_grade_id = 26 )
when I install nested_has_many_through plugin.

Would love to help fix this but dont feel I have the expertise. Hope one of you bright chaps can help sort it out.

Regards,

Kevin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions