associations refactoring, allows chaining of associated_ids query