Fix the filter scope in backend

Should be obvious: The current method works only for one-to-many relations. As this one is a many-to-many relation, it needed some modification.

The comments may need some change. Im not sure of the return value of a scope (type of $query).