There's an error because the generated SQL refers to a table server
that does not exist (its servers
).
You can use @RSB's answer, or if you want to keep the same hash syntax:
Test.joins(:server).where(servers: { admin_user_id: 1})
See example in the Active Record Query Interface Guide