Skip to content

Commit

Permalink
Merge branch 'main' into portabilis-patch-2024-06-20
Browse files Browse the repository at this point in the history
  • Loading branch information
edersoares committed Jun 20, 2024
2 parents 211bc17 + 892fb82 commit f26b185
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/classroom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Classroom < ApplicationRecord
}

scope :by_unity, ->(unity) { where(unity: unity) }
scope :by_unity_id, ->(unity_id) { where(unity_id: unity_id) }
scope :by_unity_and_grade, ->(unity_id, grade_id) { where(unity_id: unity_id).by_grade(grade_id).distinct }
scope :different_than, ->(classroom_id) { where(arel_table[:id].not_eq(classroom_id)) }
scope :by_grade, ->(grade_id) { joins(:classrooms_grades).merge(ClassroomsGrade.by_grade_id(grade_id)) }
Expand Down

0 comments on commit f26b185

Please sign in to comment.