strongloop/loopback-datasource-juggler — pull request #270 by fabien (2014-08-30 19:02:19+00:00)
Title: Enable dynamic modelTo for scopes

This is especially useful for relations/prototype scopes, as it allows you to dynamically deduce the target model from the current receiver (model instance). This is an advanced option that should otherwise have
no effect on the previous/default functionality. Basically, the targetClass is taken out of the closure and handled by a method called targetModel now.

In turn, this opens up the ability to have 'dynamically typed' (hasMany-like) polymorphic scopes. See the tests.