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: contribution.rb
    path of file: ./repos/catarse/app/models
    
    the code of the file until where you have to start completion: # coding: utf-8
# frozen_string_literal: true

class Contribution < ActiveRecord::Base
  has_notifications

  include I18n::Alchemy
  include PgSearch
  include Contribution::CustomValidators
  include Shared::CommonWrapper

  belongs_to :project
  belongs_to :reward
  belongs_to :shipping_fee
  belongs_to :user
  belongs_to :address
  belongs_to :address_answer, class_name: 'Address'
  belongs_to :donation
  belongs_to :origin
  has_many :payment_notifications
  has_many :payments
  has_many :details, class_name: 'ContributionDetail'
  has_many :balance_transactions
  accepts_nested_attributes_for :address, allow_destroy: true, limit: 1 #payment address
  accepts_nested_attributes_for :addr
    
  def common_index
    id_hash = common_id.present? ? {id: common_id} : {}

    {
      external_id: id,
      project_id: project.common_id,
      user_id: user.common_id,
      reward_id: reward&.common_id,
      # address_id: address&.common_id,
      # address_answer_id: address_answer.common_id,
      value: value,
      anonymous: anonymous,
      notified_finish: notified_finish,
      payer_name: payer_name,
      payer_email: payer_email,
      payer_document: payer_document,
      payment_choice: payment_choice,
      payment_service_fee: payment_service_fee,
      referral_link: referral_link,
      card_owner_document: card_owner_document,
      delivery_status: delivery_status,
      reward_sent_at: reward_sent_at.try(:strftime, "%FT%T"),
      reward_received_at: reward_received_at.try(:strftime, "%FT%T"),
      survey_answered_at: survey_answered_at.try(:strftime, "%FT%T"),
      deleted_at: deleted_at.try(:strftime, "%FT%T"),
      created_at: created_at.try(:strftime, "%FT%T"),
      updated_at: updated_at.try(:strftime, "%FT%T")
    }.merge!(id_hash)
  end