-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to store metadata #60
Comments
I'm running into the same limitation on my end. My work-around at the moment is to use # store meta
Logidze.with_responsible({test: 123}.to_json) do
Model.update(...)
end
# retrieve meta
meta = JSON.parse(log_data.responsible_id) However, a better API would be something like # store meta
Logidze.with_meta({test: 123}) do
Model.update(...)
end
# retrieve meta
meta = log_data.meta # => {test: 123} |
If there is some consensus on what the API should look like, I don't mind helping out with the implementation. |
I like the proposed API ( record = Model.find(123)
Logidze.with_meta(test: 123) do
record.update(attrs)
end
record.reload
# log_meta is equal to log_data.meta
meta = record.log_meta # => { "test" => 123 } Note that the resulted Hash would have stringified keys (due to JSON encoding/decoding). Feel free to propose a PR with the implementation! |
Closed by #79 and released as 0.7.0 |
Logidze is really awesome but it can't replace papertrail in a project I'm working on.
This kind of stuff does not belong to the resource itself, it would be more pleasant to store it alongside the log.
The text was updated successfully, but these errors were encountered: