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

module RailsAdmin
  module Adapters
    module Mongoid
      class Association
        attr_reader :association, :model

        delegate :autosave
    
        def nested_options
          nested = nested_attributes_options.try { |o| o[name] }
          if !nested && %i[embeds_one embeds_many].include?(macro.to_sym) && !cyclic?
            raise <<~MSG
              Embedded association without accepts_nested_attributes_for can't be handled by RailsAdmin,
              because embedded model doesn't have top-level access.
              Please add `accepts_nested_attributes_for :#{association.name}' line to `#{model}' model.
            MSG
          end

          nested
        end