The personal finance app for everyone
Show onboarding unless invitation present
Zach Gollwitzer455257bf5134
diff --git a/app/controllers/onboardings_controller.rb b/app/controllers/onboardings_controller.rbindex a9869471..bf1ecae2 100644--- a/app/controllers/onboardings_controller.rb+++ b/app/controllers/onboardings_controller.rb@@ -19,6 +19,6 @@ class OnboardingsController < ApplicationControllerenddef load_invitation- @invitation = Invitation.accepted.most_recent_for_email(Current.user.email)+ @invitation = Current.family.invitations.accepted.find_by(email: Current.user.email)endenddiff --git a/app/models/invitation.rb b/app/models/invitation.rbindex 41770b50..625d125e 100644--- a/app/models/invitation.rb+++ b/app/models/invitation.rb@@ -12,7 +12,6 @@ class Invitation < ApplicationRecordscope :pending, -> { where(accepted_at: nil).where("expires_at > ?", Time.current) }scope :accepted, -> { where.not(accepted_at: nil) }- scope :most_recent_for_email, ->(email) { where(email: email).order(accepted_at: :desc).first }def pending?accepted_at.nil? && expires_at > Time.currentdiff --git a/test/system/transactions_test.rb b/test/system/transactions_test.rbindex e51c8183..0552db92 100644--- a/test/system/transactions_test.rb+++ b/test/system/transactions_test.rb@@ -183,8 +183,10 @@ class TransactionsTest < ApplicationSystemTestCaseinvestment_account.entries.create!(name: "Investment account", date: Date.current, amount: 1000, currency: "USD", entryable: Account::Transaction.new)transfer_date = Date.currentvisit account_url(investment_account)- click_on "New"- click_on "New transaction"+ within "[data-testid='activity-menu']" do+ click_on "New"+ click_on "New transaction"+ endselect "Deposit", from: "Type"fill_in "Date", with: transfer_datefill_in "account_entry[amount]", with: 175.25