Skip to content

Commit

Permalink
Add exited startups to inactive scope
Browse files Browse the repository at this point in the history
  • Loading branch information
bodhish committed Dec 9, 2019
1 parent fa0ba4d commit 948633c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/startup.rb
Expand Up @@ -8,7 +8,7 @@ class Startup < ApplicationRecord
COURSE_FEE = 50_000

scope :admitted, -> { joins(:level).where('levels.number > ?', 0) }
scope :inactive, -> { where('access_ends_at < ?', Time.now) }
scope :inactive, -> { where('access_ends_at < ?', Time.now).or(where.not(exited_at: nil)) }
scope :not_exited, -> { where(exited_at: nil) }
scope :access_active, -> { where('access_ends_at > ?', Time.now).or(where(access_ends_at: nil)) }
scope :active, -> { not_exited.access_active }
Expand Down

0 comments on commit 948633c

Please sign in to comment.