[refactor] use rails4 where.not
Merge pull request #226 from Genshin/mass_cleaning_refactor_set_primary

[refactor] use rails4 where.not