fix double delete checkbox in has_many

and extends test to cover this problem. this fixes #3525