The expected download of Ruby on Rails does not work properly for the following scenario.
First we had a model called mark, which has the following fields
id, student, subject, mark
the student is a string column with the active directory entry name, and later for reporting functions another table is introduced with the name user, which has the following fields:
id, ad_name, full_name
Now on the Mark model we have added class affiliation
belongs to_to: student_details ,: class_name => "User" :: foreign_key => "student" ,: primary_key => "ad_name"
and when loading using the ActiveRecord search method, we pass the included conditon for heavy loading
Marks.find (: all ,: include =>: reserved_user)
but when a search is performed, a student selection request is made for each marking.
Is this a known bug in ROR? or am I missing something?
source
share