Hello,
I am using ash_papertrail for audit logs. But I have setup 2 actors like this:
paper_trail do
# default is :uuid
primary_key_type(:uuid_v7)
# default is :snapshot
change_tracking_mode(:changes_only)
# default is false
store_action_name?(true)
# the primary keys are always ignored
ignore_attributes([:inserted_at, :updated_at])
# default is []
ignore_actions([:destroy])
store_action_inputs?(true)
store_resource_identifier?(true)
# Passed through actor
belongs_to_actor(:user, Mgx.Accounts.User, domain: Mgx.Accounts)
# Have existing relastionship
belongs_to_actor(:company_information, Mgx.Company.CompanyInformation, domain: Mgx.Company)
end
So in the LiveView, I am passing actor as current_user
like this which works, but user_id
,
form =
company_information
|> AshPhoenix.Form.for_update(:update_company_documents,
as: "company-information",
forms: [auto?: true],
actor: socket.assigns.current_user
)
Since actor can be only one, is there is any way I can pass company_information_id
?
. Or any other way, by removing actor looked into
mixin
, But didn’t understand properly. I tried putting company_information_id
in the params but didn’t work either
Appreciate for any help. Thank you