def define_associate_instance_getter_method(associate)
      define_method associate.name do
        instance = instance_variable_get("@#{associate.name}") || instance_variable_set("@#{associate.name}", associate.klass.new)

        depending = associates.select { |_associate| _associate.dependent_names.include?(associate.name) }
        depending.each do |_associate|
          existing = send(_associate.name).send(associate.name)
          send(_associate.name).send("#{associate.name}=", instance) unless existing
        end

        instance
      end
    end
def define_associate_instance_getter_method(associate)
      define_method associate.name do
        instance = instance_variable_get("@#{associate.name}") || instance_variable_set("@#{associate.name}", associate.klass.new)

        depending = associates.select { |_associate| _associate.dependent_names.include?(associate.name) }
        depending.each do |_associate|
          existing = send(_associate.name).send(associate.name)
          send(_associate.name).send("#{associate.name}=", instance) unless existing
        end

        instance
      end
    end
Define associated model instance getter method

 @example

   @association.user

 @param associate [Item]