mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
Allow connecting a few accounts before upgrade prompt
This commit is contained in:
parent
c1e48bd3c9
commit
1620d56e2d
2 changed files with 5 additions and 0 deletions
|
@ -12,6 +12,7 @@ class ApplicationController < ActionController::Base
|
||||||
return false unless Current.session
|
return false unless Current.session
|
||||||
return false if Current.family.subscribed?
|
return false if Current.family.subscribed?
|
||||||
return false if subscription_pending? || request.path == settings_billing_path
|
return false if subscription_pending? || request.path == settings_billing_path
|
||||||
|
return false if Current.family.active_accounts_count <= 3
|
||||||
|
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
|
@ -209,6 +209,10 @@ class Family < ApplicationRecord
|
||||||
entries.order(:date).first&.date || Date.current
|
entries.order(:date).first&.date || Date.current
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def active_accounts_count
|
||||||
|
accounts.active.count
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
CategoriesWithTotals = Struct.new(:total_money, :category_totals, keyword_init: true)
|
CategoriesWithTotals = Struct.new(:total_money, :category_totals, keyword_init: true)
|
||||||
CategoryWithStats = Struct.new(:category, :amount_money, :percentage, keyword_init: true)
|
CategoryWithStats = Struct.new(:category, :amount_money, :percentage, keyword_init: true)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue