has_internal_id.rb 378 B

123456789101112131415
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. # Provide the internal id only for objects that need it, for example
  3. # in URLs.
  4. module Gql::Concern::HasInternalId
  5. extend ActiveSupport::Concern
  6. included do
  7. field :internal_id, Integer, null: false, description: 'Internal database ID'
  8. def internal_id
  9. object.id
  10. end
  11. end
  12. end