mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-25 08:09:38 +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
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