You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: avatars.rb
    path of file: ./repos/openproject/modules/avatars/app/models/users
    
    the code of the file until where you have to start completion: # OpenProject Avatars plugin
#
# Copyright (C) 2017  OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Found
    
    def local_avatar_attachment=(file)
      local_avatar_attachment&.destroy
      reset_avatar_attachment_cache!

      @local_avatar_attachment = Attachments::CreateService
        .new(user: User.system, contract_class: EmptyContract)
        .call(file:, container: self, filename: file.original_filename, description: 'avatar')
        .result

      touch
    end