Closed janko closed 1 week ago
This is useful in when delivering emails in a background job, where the background job is given the account ID. In that case, the Rodauth instance needs to be initialized outside of a request, and account and token loaded into it.
This is what rodauth-rails has been doing so far:
rodauth = RodauthApp.rodauth.allocate rodauth.instance_eval { @account = account_ds(account_id).first! }
With the new method it can be cleaner:
rodauth = RodauthApp.rodauth.allocate rodauth.account_from_id(account_id)
There are also several places within Rodauth that can make use of this method.
This is useful in when delivering emails in a background job, where the background job is given the account ID. In that case, the Rodauth instance needs to be initialized outside of a request, and account and token loaded into it.
This is what rodauth-rails has been doing so far:
With the new method it can be cleaner:
There are also several places within Rodauth that can make use of this method.