Ash FrameworkAF
Ash Framework3y ago
4 replies
Blibs

set user_id field with actor id during create action

I have a resource that has the following relationship:

  relationships do
    belongs_to :user, Accounts.User do
      allow_nil? false
    end
  end

I want to create a create action that will create a new instance of that resource but without having to send the user_id with the resources params, I want to get it directly from the current actor, is there command to do that without a manual action?
Was this page helpful?