mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 14:31:25 +00:00
Onboarding redirect tests and trial status bar (#2197)
* Onboarding redirect tests and trial status bar * use helper method * Fix time tolerance failure * Update post-onboarding message to be generic * Disable turbo frames on Trial start button * Update flash notice in test
This commit is contained in:
@@ -8,16 +8,14 @@ class SubscriptionsController < ApplicationController
|
||||
end
|
||||
|
||||
def start_trial
|
||||
if Current.family.trial_started_at.present?
|
||||
redirect_to root_path, alert: "You've already started or completed your trial"
|
||||
else
|
||||
Family.transaction do
|
||||
Current.family.update(trial_started_at: Time.current)
|
||||
Current.user.update(onboarded_at: Time.current)
|
||||
unless Current.family.trialing?
|
||||
ActiveRecord::Base.transaction do
|
||||
Current.user.update!(onboarded_at: Time.current)
|
||||
Current.family.update!(trial_started_at: Time.current)
|
||||
end
|
||||
|
||||
redirect_to root_path, notice: "Your trial has started"
|
||||
end
|
||||
|
||||
redirect_to root_path, notice: "Welcome to Maybe!"
|
||||
end
|
||||
|
||||
def new
|
||||
|
||||
Reference in New Issue
Block a user