Skip to content

registered_at is not updated when a user re-registered #12830

@FinnIckler

Description

@FinnIckler

I got this reported for https://www.worldcubeassociation.org/registrations/1251481/edit
The user registered, then deleted their registration and then registered again.
The registered_at still points to their original registration, which does mess with the sorting.

This is because

# Set a `registered_at` timestamp for newly created records,
  #   but only if there is no value already specified from the outside
  after_initialize :mark_registered_at, if: :new_record?, unless: :registered_at?

  private def mark_registered_at
    self.registered_at = current_time_from_proper_timezone
  end

is the only time we set registered_at. We need to update it when a user changes their status from cancelled -> pending

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions