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: has_one.rb
    path of file: ./repos/administrate/lib/administrate/field
    
    the code of the file until where you have to start completion: require_relative "associative"

module Administrate
  module Field
    class HasOne < Associative
      def self.permitted_attribute(attr, options = {})
        resource_class = options[:resource_class]
        final_associated_class_name =
     
    
      def self.permitted_attribute(attr, options = {})
        resource_class = options[:resource_class]
        final_associated_class_name =
          if options.key?(:class_name)
            Administrate.warn_of_deprecated_option(:class_name)
            options.fetch(:class_name)
          elsif resource_class
            associated_class_name(resource_class, attr)
          else
            Administrate.warn_of_missing_resource_class
            if options
              attr.to_s.singularize.camelcase
            else
              attr
            end