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: relationship.rb
    path of file: ./repos/manageiq/app/models
    
    the code of the file until where you have to start completion: require 'ancestry'

class Relationship < ApplicationRecord
  has_ancestry

  belongs_to :resource, :polymorphic => true

  scope :in_relationship, ->(rel) { where({:relationship => rel}) }

  #
  # Filtering methods
  #

  def self.filtered(of_
    
  def self.stringify_resource_pairs(resource_pairs, options = {})
    options.reverse_merge!(
      :field_delimiter  => ':',
      :record_delimiter => '/',
      :exclude_class    => false
    )

    fields = resource_pairs.collect do |pair|
      options[:exclude_class] ? pair.last : pair.join(options[:field_delimiter])
    end
    fields.join(options[:record_delimiter])
  end