Skip to content

Commit

Permalink
ETQ intégrateur d’API, je veux que le dossier soit remonté comme modi…
Browse files Browse the repository at this point in the history
…fié quand ces instructeurs changent
  • Loading branch information
tchak committed Oct 3, 2024
1 parent ecb3133 commit d3a4a94
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/instructeur.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,16 @@ def follow(dossier)
rescue ActiveRecord::RecordInvalid => e
# ActiveRecord validation
raise unless e.record.errors.details.dig(:instructeur_id, 0, :error) == :taken
ensure
dossier.touch(:updated_at)
end
end

def unfollow(dossier)
f = follows.find_by(dossier: dossier)
if f.present?
f.update(unfollowed_at: Time.zone.now)
dossier.touch(:updated_at)
end
end

Expand Down

0 comments on commit d3a4a94

Please sign in to comment.