djacobs7
AEAsh Elixir
•Created by djacobs7 on 10/12/2023 in #support
Is there a plug for setting the tenant?
I am building an app where users can belong to different organizations. I want each organization to be it's own tenant ( https://hexdocs.pm/ash/multitenancy.html ). When the user is logged in, they select a tenant, and can only have access to data from that tenant.
Is there a way call set_tenant in a router plug ( similar to Ash.PlugHelpers.set_actor(user) ) so that I can globally set the current tenant, without for any queries that might need it?
4 replies
AEAsh Elixir
•Created by djacobs7 on 9/5/2023 in #support
Is there a good way to version string documents in ash?
I have a table of TODOs, with one column, a :description. A user can modify a TODO's description. I'd like to efficiently store the history of a document, so that the user can look through different past versions of the doc. Is there an easy/built-in way to do this in Ash?
3 replies
AEAsh Elixir
•Created by djacobs7 on 8/18/2023 in #support
How can I do a 'like' query or similarity search?
Hi,
I am looking to do fuzzy search. So, for example , if the user types in 'dan'. I'd like to return all users whose names or emails include 'dan'. I read through the predicate list here: https://hexdocs.pm/ash/Ash.Filter.html hoping for something like 'like' in SQL, but I didnt see naything. What is the best approach?
Here is how my code looks currently:
App.EmailHandler.User
|> Ash.Query.filter(
[or: [
[email: search_slug],
[name: search_slug]
]])
9 replies