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: attributes.rb
    path of file: ./repos/mongoid/lib/mongoid
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
# rubocop:todo all

require "active_model/attribute_methods"
require "mongoid/attributes/dynamic"
require "mongoid/at
    
    def remove_attribute(name)
      validate_writable_field_name!(name.to_s)
      as_writable_attribute!(name) do |access|
        _assigning do
          attribute_will_change!(access)
          delayed_atomic_unsets[atomic_attribute_name(access)] = [] unless new_record?
          attributes.delete(access)
        end
      end
    end