Moves relations fetching from views to the controller and skip invalid relations (#7385).
Authored by: jplang 2011-01-22
Parent: [r4740]
Child: [r4742]