has_many_associations bug fix