As discussed in https://github.com/jeremyevans/rodauth/discussions/267, this is useful when sharing database tables between different Rodauth configurations, and wanting to store the account type alongside account records, as it allows filtering retrieved accounts in a single place.
Example usage:
plugin :rodauth, name: :admin do
enable :create_account, :login
before_create_account do
account[:type] = "admin"
end
auth_class_eval do
def account_table_ds
super.where(type: "admin")
end
end
end
As discussed in https://github.com/jeremyevans/rodauth/discussions/267, this is useful when sharing database tables between different Rodauth configurations, and wanting to store the account type alongside account records, as it allows filtering retrieved accounts in a single place.
Example usage: