Browse Source

Update organisation status logic to account for future start dates of the first change

pull/3057/head
Manny Dinssa 2 weeks ago
parent
commit
658208c281
  1. 2
      app/models/organisation.rb

2
app/models/organisation.rb

@ -217,7 +217,7 @@ class Organisation < ApplicationRecord
name: self[:name],
start_date: created_at,
end_date: changes.first&.dig(:start_date)&.yesterday,
status: changes.empty? ? "active" : "inactive",
status: changes.empty? || Time.zone.now.to_date < changes.first[:start_date] ? "active" : "inactive",
)
changes

Loading…
Cancel
Save