From da713da4cb071d51e3f745691f057b84614d2744 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Date: Mon, 14 Oct 2024 20:18:35 -0300 Subject: [PATCH] Resolves #4689 - Update seeds: mark users `invitation_status` as "accepted" (#4705) * Update seed users to mark invitation status accepted * Update with PR suggestions --- Gemfile.lock | 2 +- db/seeds.rb | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b0e65676e1..e105eb0cec 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -798,4 +798,4 @@ DEPENDENCIES webmock (~> 3.24) BUNDLED WITH - 2.5.20 + 2.5.21 diff --git a/db/seeds.rb b/db/seeds.rb index dc544ab2a4..55c5a3d308 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -865,3 +865,17 @@ def seed_quantity(item_name, organization, storage_location, quantity) ] ) TransferCreateService.call(transfer) + +# ---------------------------------------------------------------------------- +# Users invitation status +# ---------------------------------------------------------------------------- +# Mark users `invitation_status` as `accepted` +# +# Addresses and resolves issue #4689, which can be found in: +# https://github.com/rubyforgood/human-essentials/issues/4689 +User.where(invitation_token: nil).each do |user| + user.update!( + invitation_sent_at: Time.current, + invitation_accepted_at: Time.current + ) +end \ No newline at end of file