From 5ec0e2ed18b2245115633b12da04fdeeaaf36434 Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Thu, 20 Jul 2017 10:40:40 +0200 Subject: [PATCH] Dossier: remove unused ordered_commentaires as commentaires are sorted on the view _messagerie.haml.html dossier_facade.commentaires.object.sort --- app/facades/dossier_facades.rb | 2 +- app/models/dossier.rb | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/facades/dossier_facades.rb b/app/facades/dossier_facades.rb index dfb7f73ab..a5143b6b3 100644 --- a/app/facades/dossier_facades.rb +++ b/app/facades/dossier_facades.rb @@ -38,7 +38,7 @@ class DossierFacades end def commentaires - @dossier.ordered_commentaires.where(champ_id: @champ_id).decorate + @dossier.commentaires.where(champ_id: @champ_id).decorate end def procedure diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 50b9f1ed3..a53d49db3 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -128,10 +128,6 @@ class Dossier < ActiveRecord::Base champs.joins(', types_de_piece_justificative').where("pieces_justificatives.type_de_piece_justificative_id = types_de_piece_justificative.id AND types_de_piece_justificative.procedure_id = #{procedure.id}").order('order_place ASC') end - def ordered_commentaires - commentaires.order(created_at: :desc) - end - def next_step! role, action, motivation = nil unless %w(initiate follow update comment receive refuse without_continuation close).include?(action) fail 'action is not valid'