demarches-normaliennes/app/services/falsify_opendata_service.rb

16 lines
318 B
Ruby
Raw Normal View History

class FalsifyOpendataService
def self.call(lines)
errors = []
lines.each do |line|
id = line["id"]
procedure = Procedure.find_by(id: id)
if procedure
procedure.update(opendata: false)
else
errors << "Procedure #{id} introuvable"
end
end
errors
end
end