Remove TypeDeChamp.to_stable_id

This commit is contained in:
Paul Chavard 2020-09-15 18:53:51 +02:00
parent 4d6e25a8f1
commit 3d3d0259a0
2 changed files with 4 additions and 25 deletions

View file

@ -309,21 +309,6 @@ class TypeDeChamp < ApplicationRecord
end
end
# FIXME: We are changing how id is exposed to the editor.
# We used to expose type_de_champ.id as primary key to the editor. With revisions
# we need primary key to be type_de_champ.stable_id because any update can create
# a new version but we do not want editor to know about this.
# This is only needed for a clean migration without downtime. We want to ensure
# that if editor send a simple id because it was loaded before deployment
# we would still do the right thing.
def self.to_stable_id(id_or_stable_id)
if id_or_stable_id.to_s =~ /^stable:/
id_or_stable_id.to_s.gsub(/^stable:/, '')
else
id_or_stable_id
end
end
private
def parse_drop_down_list_value(value)