Skip to content

Commit

Permalink
Merge pull request #167 from portabilis/portabilis-patch-2024-06-20
Browse files Browse the repository at this point in the history
Portabilis patch 20/06/2024
  • Loading branch information
edersoares authored Jun 20, 2024
2 parents 211bc17 + f26b185 commit 4f39a24
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 4f39a24

Please sign in to comment.