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

require "pg_party/model_decorator"

module PgParty
  module Model
    module SharedMethods
      def reset_primary_key
        return base_class.primary_key if self != base_class

        partitions = partitions(include_subpartitions: PgP
    
      def reset_primary_key
        return base_class.primary_key if self != base_class

        partitions = partitions(include_subpartitions: PgParty.config.include_subpartitions_in_partition_list)
        return get_primary_key(base_class.name) if partitions.empty?

        first_partition = partitions.detect { |p| !connection.table_partitioned?(p) }
        raise 'No leaf partitions exist for this model. Create a partition to contain your data' unless first_partition

        in_partition(first_partition).get_primary_key(base_class.name)
      end