2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-03-01 11:06:58 +01:00
|
|
|
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
|