Fix issue #333 Relations don't have proper adapter set when using application store

This test demonstrates #333