Fixes #5191: Sandbox was ignored for models and AR relations