class MaterialVersion < ApplicationRecord
  EVENT_TYPE_MAP = { create: 'create',
                     update: 'update',
                     discard: 'discard',
                     restore: 'restore' }.freeze

  include VersionRecord

  belongs_to :material
  belongs_to :tag, optional: true
  belongs_to :parent, class_name: 'Material', optional: true
  belongs_to :updated_by_user, class_name: 'User', optional: true

  def export_paths_hash
    export_paths_json || {}
  end
end
