use attachments_count on attachments model