Verified Commit dcebcd66 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻
Browse files

fix terminatable? and terminated? method on group_offer model

parent 9ac2c7d0
......@@ -74,11 +74,11 @@ class GroupOffer < ApplicationRecord
scope :terminated, (-> { field_not_nil(:period_end_set_by) })
def terminatable?
group_assignments.have_start.any? || group_assignment_logs.any?
group_assignments.unterminated.none?
end
def terminated?
period_end_set_by.present?
period_end_set_by.present? && period_end.present?
end
def active_group_assignments_between?(start_date, end_date)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment