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: songsheet.rb
    path of file: ./repos/chordbook/app/models
    
    the code of the file until where you have to start completion: class Songsheet < ApplicationRecord
  include AlphaPaginate
  include Metadata
  include PgSearch::Model
  include Viewable

  has_paper_trail

  belongs_to :track, optional: true, counter_cache: true
  has_many :artist_works, as: :work, dependent: :destroy
  has_many :artists, through: :artist_works
  has_many :library_items, as: :item, dependent: :destroy
  has_many :setlist_items, dependent: :d
    
  def search_data
    {
      type: self.class,
      title: title,
      subtitle: Array(metadata["artist"]).to_sentence,
      attachment_id: track&.album&.image_attachment&.id,
      # Because searchkick doesn't support `cross_fields`
      # https://github.com/ankane/searchkick/pull/871
      everything: [title, metadata["artist"] || metadata["subtitle"], track&.album&.title].compact.flatten,
      boost: 3.0
    }
  end

  def all_media
    (Array(metadata["media"]) + Array(track&.media)).flatten.compact.uniq
  end
end