Skip to content
Snippets Groups Projects
Unverified Commit 7fad72cf authored by John Swanson's avatar John Swanson Committed by GitHub
Browse files

Fix dispatch error in `with-model-cleanup` (#38584)

`with-model-cleanup` is called like so:

```
(with-model-cleanup [:model/User]
 ...)
```

This ends up calling:

```
(with-model-cleanup-additional-conditions model)
```

to get the additional conditions necessary when "cleaning up" the model.
This multimethod dispatched on `mi/model`.

But `(mi/model :model/User)` is `nil`. Instead, we *already have* the
model, not an instance of it, so we want to dispatch on that to
properly clean up after ourselves.
parent c7f1ac93
Branches
Tags
No related merge requests found
......@@ -643,7 +643,7 @@
"Additional conditions that should be used to restrict which instances automatically get deleted by
`with-model-cleanup`. Conditions should be a HoneySQL `:where` clause."
{:arglists '([model])}
mi/model)
identity)
(defmethod with-model-cleanup-additional-conditions :default
[_]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment