Changed the matcher to get the connection from the model class, not the instance of the model

To avoid the deprecation warning from #992d87db02507363a4ad4ab40a3e4c4b32cf0408