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: relatable.rb
    path of file: ./repos/consuldemocracy/app/models/concerns/sdg
    
    the code of the file until where you have to start completion: module SDG::Relatable
  extend ActiveSupport::Concern

  included do
    has_many :sdg_relations, as: :relatable, dependent: :destroy, class_name: "SDG::Relation"

    %w[SDG::Goal SDG::LocalTarget].each do |sdg_type|
      has_many sdg_type.constantize.table_name.to_sym,
               through: :sdg_relations,
               source: :related_sdg,
               source_type: sdg_type
    end
    has_many :sdg_global_targets,
             through: :sdg_relations,
             source: :related_sdg,
  
    
  def related_sdg_list=(codes)
    target_codes, goal_codes = codes.tr(" ", "").split(",").partition { |code| code.include?(".") }
    local_targets_codes, global_targets_codes = target_codes.partition { |code| code.split(".")[2] }
    global_targets = global_targets_codes.map { |code| SDG::Target[code] }
    local_targets = local_targets_codes.map { |code| SDG::LocalTarget[code] }
    goals = goal_codes.map { |code| SDG::Goal[code] }

    transaction do
      self.sdg_local_targets = local_targets
      self.sdg_global_targets = global_targets
      self.sdg_goals = (global_targets.map(&:goal) + local_targets.map(&:goal) + goals).uniq
    end
  end