I just noticed that the read preference doesn't seem to be applied to some commands like count and distinct and probably others.
Here is an example from our production database:
10.10.11.7 is primary
10.10.11.8 is secondary
I also tried with
as I saw
RUBY-850 but it doesn't work either.
SERVER-22043 talking about the same kind of issue in the CLI, and it was fixed by using runReadCommand instead of runCommand I don't know if it has anything to do here but maybe.
Also, I couldn't find any info about .with() in Mongoid doc and used the mongo ruby doc instead, maybe you should add a few lines about it.