need to to_a the Relation to execute SQL here
Merge pull request #8728 from amatsuda/model_all_returns_a_relation

A small fix for an AR test case