Fix get entreprise 404 not found

This commit is contained in:
Xavier J 2016-08-02 14:45:09 +02:00
parent a37320bae9
commit 9bf8005658
2 changed files with 6 additions and 0 deletions

View file

@ -2,4 +2,6 @@ class Entreprise < ActiveRecord::Base
belongs_to :dossier
has_one :etablissement, dependent: :destroy
has_one :rna_information, dependent: :destroy
validates_presence_of :siren
end

View file

@ -9,6 +9,10 @@ class DossierService
def dossier_informations!
@entreprise_adapter = SIADE::EntrepriseAdapter.new(DossierService.siren @siret)
if @entreprise_adapter.to_params.nil?
raise RestClient::ResourceNotFound
end
@dossier.create_entreprise(@entreprise_adapter.to_params)
@etablissement_adapter = SIADE::EtablissementAdapter.new(@siret)