-
Notifications
You must be signed in to change notification settings - Fork 93
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
Ability to delete multiple features and to initialise existing record #97
Conversation
marioimr
commented
Jul 8, 2020
- change to PaperTrail.Multi.delete/3 to enable reception of model_key and version_key to execute multiple deletions (on the model of Ecto.Multi.insert/3
- add PaperTrail.initialise/2 to have function that explicitly initialise an already existing record into versions table
@@ -12,6 +12,22 @@ defmodule PaperTrail do | |||
defdelegate get_versions(model, id, options), to: PaperTrail.VersionQueries | |||
defdelegate get_current_model(version), to: PaperTrail.VersionQueries | |||
|
|||
@doc """ | |||
Intialise paper_trail for existing record |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this? "Explicitly inserts an already non-versioned existing record into versions table"
lib/paper_trail/multi.ex
Outdated
@@ -110,11 +110,14 @@ defmodule PaperTrail.Multi do | |||
def delete( | |||
%Ecto.Multi{} = multi, | |||
struct, | |||
options \\ [origin: nil, meta: nil, originator: nil, prefix: nil] | |||
options \\ [origin: nil, meta: nil, originator: nil, prefix: nil, model_key: :model, version_key: :version] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call, thanks!
Hi @izelnakri, absolutely in the next days I'll add tests as well. Thank you! |
a06c813
to
675d502
Compare
Hi @marioimr , I'm willing to merge this PR once the asked changes and tests are added. Thanks! |