Skip to content
This repository was archived by the owner on Mar 28, 2024. It is now read-only.

Commit d6a41ec

Browse files
committed
Add current scopes for time range models
1 parent 7923933 commit d6a41ec

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

app/models/induction_period.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ class InductionPeriod < ApplicationRecord
2121
belongs_to :mentorship
2222
belongs_to :appropriate_body
2323
belongs_to :induction_programme
24+
25+
scope :current, -> { where(finished_on: nil) }
2426
end

app/models/tenureship.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ class Tenureship < ApplicationRecord
1919
belongs_to :teacher
2020
belongs_to :school
2121
has_many :mentorships
22+
23+
scope :current, -> { where(finished_on: nil) }
2224
end

0 commit comments

Comments
 (0)