Add id argument to most collections on dossier

This commit is contained in:
Paul Chavard 2021-01-28 13:53:01 +01:00
parent 0bd8721776
commit bb072ba9e9
6 changed files with 92 additions and 19 deletions

View file

@ -13,6 +13,10 @@ class ApplicationRecord < ActiveRecord::Base
raise ActiveRecord::RecordNotFound, e.message
end
def self.id_from_typed_id(id)
GraphQL::Schema::UniqueWithinType.decode(id)[1]
end
def to_typed_id
GraphQL::Schema::UniqueWithinType.encode(self.class.name, id)
end