Hi @stevewi. This happens because predicate modules are used as simple containers of methods. These predicates are resolved using D::V::PredicateRegistry
. D::V::Schema#predicates
is responsible for populating this registry. It doesn’t merge new predicates into the predicates set before, it just replaces them:
I had a similar problem so I came up with this workaround (the topic didn’t get much attention though). Basically, it employs modules which define predicates when included in the schema.
I use this workaround in production but I’m not happy with it, because I believe it has too much knowledge of the inner workings of the gem for an external “plugin”.