mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 23:59:40 +02:00
Account Sync should happen at login, 1x per day, OR on-demand (#594)
* Add last_sync_date to accounts table * Always sync Account after Valuation or Transaction creation, update, or deletion. Skip sync if user clicks "sync" button without changing anything * Sync user accounts daily based on last_login_at
This commit is contained in:
parent
4f0b2de4ef
commit
315c4bf1ec
8 changed files with 48 additions and 8 deletions
|
@ -3,11 +3,13 @@ module Authentication
|
|||
|
||||
included do
|
||||
before_action :authenticate_user!
|
||||
after_action :set_last_login_at
|
||||
end
|
||||
|
||||
class_methods do
|
||||
def skip_authentication(**options)
|
||||
skip_before_action :authenticate_user!, **options
|
||||
skip_after_action :set_last_login_at, **options
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -31,4 +33,8 @@ module Authentication
|
|||
Current.user = nil
|
||||
reset_session
|
||||
end
|
||||
|
||||
def set_last_login_at
|
||||
Current.user.update(last_login_at: DateTime.now)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue