# frozen_string_literal: true

module Syncable
  extend ActiveSupport::Concern

  def as_json(params = {})
    json = super(params)
    json.each do |key, value|
      if key == "id"
        json[key] = value.to_s 
      end
    end
    {
      id: id.to_s,
      type: model_name.param_key,
      attributes: json
    }
  end
end
