demarches-normaliennes/app/models/concerns/dossier_prefillable_concern.rb
2022-12-08 15:27:39 +01:00

12 lines
297 B
Ruby

# frozen_string_literal: true
module DossierPrefillableConcern
extend ActiveSupport::Concern
def prefill!(champs_public_attributes)
return unless champs_public_attributes.any?
assign_attributes(champs_public_attributes: champs_public_attributes)
save(validate: false)
end
end