Fix where scope on has_one deal