mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
Implement auto family syncs on login (#1021)
This commit is contained in:
parent
c8590d53ba
commit
ef4be7948a
11 changed files with 59 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
|||
class ApplicationController < ActionController::Base
|
||||
include Authentication, Invitable, SelfHostable
|
||||
include AutoSync, Authentication, Invitable, SelfHostable
|
||||
include Pagy::Backend
|
||||
|
||||
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
|
||||
|
|
13
app/controllers/concerns/auto_sync.rb
Normal file
13
app/controllers/concerns/auto_sync.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
module AutoSync
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
before_action :sync_family, if: -> { Current.family.present? && Current.family.needs_sync? }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def sync_family
|
||||
Current.family.sync
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue