Skip to content

Commit

Permalink
Preload rib and attachments in ClassesFacade
Browse files Browse the repository at this point in the history
  • Loading branch information
pskl committed Oct 9, 2024
1 parent 3b3ceee commit 8fc25c7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/facades/classes_facade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

class ClassesFacade
def initialize(classes)
@classes = classes.includes(:school_year)
@classes = classes.includes(
:school_year,
students: :ribs,
schoolings:
[
{ attributive_decision_attachment: :blob },
{ abrogation_decision_attachment: :blob }
]
)
end

def nb_students_per_class
Expand Down

0 comments on commit 8fc25c7

Please sign in to comment.