Follow: remove old backoffice follow and toggle_follow

This commit is contained in:
Simon Lehericey 2017-07-17 12:27:33 +02:00 committed by Mathieu Magnin
parent a7f270bac4
commit 95fbd1824a
5 changed files with 0 additions and 121 deletions

View file

@ -34,17 +34,6 @@ class Gestionnaire < ActiveRecord::Base
dossiers.where(id: dossier_id).any?
end
def toggle_follow_dossier dossier_id
dossier = dossier_id
dossier = Dossier.find(dossier_id) unless dossier_id.class == Dossier
Follow.create!(dossier: dossier, gestionnaire: self)
rescue ActiveRecord::RecordInvalid
Follow.where(dossier: dossier, gestionnaire: self).delete_all
rescue ActiveRecord::RecordNotFound
nil
end
def follow(dossier)
return if follow?(dossier)