Replies: 1 comment 1 reply
-
My recommendation would be to use separate tables for separate types of users. However, I would be OK adding an |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently recommending users of rodauth-rails to share the same
account*
tables between Rodauth configurations, to keep the database schema DRY, and store an account type identifier in the database.The account type is saved on account creation, and retrieved to filter the account. I first thought I only need to override the
account_ds
method, but I realized during the live stream that_account_from_login
would need to be overridden as well. Below is a full example of such setup:If this is legit from the design perspective, my question is whether it's worth making the account filtering easier, so that it only needs to be done in one place instead of two (
account_ds
and_account_from_login
). I was thinking of extractingdb[accounts_table]
in a separate method, but I don't know how to call it. Another idea was adding anaccount_filter
configuration method, which would be passed towhere
in bothaccount_ds
and_account_from_login
, and would default to an empty hash. What do you think?Beta Was this translation helpful? Give feedback.
All reactions