Right.find_by_site_id_and_user_id(Site.find(1), User.new)
SELECT * FROM `rights` WHERE (`rights`.`site_id` = 1 AND `rights`.`user_id` = NULL) LIMIT 1
Right.find_by_site_id_and_user_id(Site.find(1), User.new)
SELECT `rights`.* FROM `rights` WHERE `rights`.`site_id` = 1 AND `rights`.`user_id` IS NULL LIMIT 1
If there are some records which user_id column is NULL, then, it is obvious that we’ll have some problems.