Reset a user's wizard progress from Rails Console

Sometimes I find the Custom Wizard progress can get corrupted and you end up in an endless loop.

I wanted to find a way to ‘reset’ the progress.

So:

  • log onto your server
  • enter the rails console

then use the following script:

    most_recent = ::UserHistory.where(
      acting_user_id: 1,
      action: ::UserHistory.actions[:custom_wizard_step]
    ).distinct.order('updated_at DESC').first

Replacing ‘1’ with the user id in question.

then

most_recent.destroy

The wizard will now no longer know where to start off from so should start at the start :slight_smile:

2 Likes