-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Description
The require-model-namespaces-and-find-hydration-keys function loops over every var in every namespace to check if it's a model. To do this it calls :toucan.models/model (via toucan.models/model?) on the var's value.
(:toucan.models/model val)This is problematic since that value could be anything, and calling it like this with a keyword could have all kinds of side effects.
To make this concrete, say Datomic is present and loaded in the same process as Toucan, then it will call
(toucan.models/model? datomic.pull/normalized-pattern-cache)Which raises an exception, making Toucan unusable.
@camsaul I'm not sure what to propose as the best solution here, in my project I've monkey-patched require-model-namespaces-and-find-hydration-fns to call (and (record? model) (models/model? model)). Would that be acceptable?
Metadata
Metadata
Assignees
Labels
No labels