demarches-normaliennes/app/models/logic/not_in_departement_operator.rb
2024-02-13 11:57:31 +01:00

14 lines
290 B
Ruby

class Logic::NotInDepartementOperator < Logic::InDepartementOperator
def operation
:n_est_pas_dans_le_departement
end
def compute(champs = [])
l = @left.compute(champs)
r = @right.compute(champs)
return false if l.nil?
l.fetch(:code_departement) != r
end
end