1
0
Fork 0
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:
Zach Gollwitzer 2024-07-25 12:51:50 -04:00 committed by GitHub
parent c8590d53ba
commit ef4be7948a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 59 additions and 9 deletions

View file

@ -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.

View 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