Browse Source

Update status assignment logic in organisation.rb to reflect active state when no changes exist

pull/3053/head
Manny Dinssa 2 weeks ago
parent
commit
0dff592fdc
  1. 2
      app/models/organisation.rb

2
app/models/organisation.rb

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

Loading…
Cancel
Save