[UserCap BE] Remove `created` state from Member
Problem
All existing Members are in an initial state of created
. When the feature flag is enabled, new members will correctly be assigned to awaiting
or active
accordingly, and access will be restricted to groups based on these states, but the old/existing records will remain in created
.
Proposal
Remove the created
state from Member
and replace it with active
.
Please see #346565 (comment 754778119) for further details and conversation as to why this approach is being taken.
Steps
As a starting point, the following steps should be considered:
- Replace the state values and transitions in the state machine, here
- Add an
active?
method override as shown here - Create background migration to update the state value for
Member.where(state: 2)
to0
- Clean-up uses/references to
created
state (API, docs, there maybe others) - In a follow-up future milestone, remove the
active?
override in step 2 above
Availability & Testing
Tests should be authored detailing the behavior of this feature flag. "When the feature flag is enabled, it behaves like this. When the feature flag is disabled, it behaves like that."
Edited by Dan Davison