Closed Eiji7 closed 8 years ago
This can be achieved pretty easy already with the whodoneit-map
install option. For example, in the example in the readme file, you can modify the defp whodoneit(conn) do
function to create your own map, including with what ever data you want.
I don't think an additional map is required.
Can I keep relation belongs_to
to User
and store map of additional data at same time?
I need one more query for each version instead of querying by relations.
Is there a good reason to do so? Can you give an example that warrants having both a module model reference and a separate map of additional data. I'm a little hesitant since it adds additional complication and I want to make sure there is a good use case for it.
For example: I know Mike. He is good editor and my friend from real world, but his account was hacked (e.g "Social engineering").
has_many
reference).So, what wrong with using the whodoneit-map
option and store the following map?
%{user_id: user.id, request_ip: header.ip, username: user.username, ...}
See: Add dependent opts #723. I want to use dependent for versions (see example in point 3 of my comment above).
I want to save more data that is not stored in User model e.g request data. For example: