fix removing duplicated rows when outer_joins is used in nested scaffolds on rails4