Delete un-user code in DossierDecorator
This commit is contained in:
parent
3c11bef503
commit
fb16d4582d
2 changed files with 6 additions and 17 deletions
|
@ -2,12 +2,6 @@ class DossierDecorator < Draper::Decorator
|
||||||
delegate :current_page, :per_page, :offset, :total_entries, :total_pages
|
delegate :current_page, :per_page, :offset, :total_entries, :total_pages
|
||||||
delegate_all
|
delegate_all
|
||||||
|
|
||||||
def display_date
|
|
||||||
date_previsionnelle.localtime.strftime('%d/%m/%Y')
|
|
||||||
rescue
|
|
||||||
'dd/mm/YYYY'
|
|
||||||
end
|
|
||||||
|
|
||||||
def first_creation
|
def first_creation
|
||||||
created_at.localtime.strftime('%d/%m/%Y %H:%M')
|
created_at.localtime.strftime('%d/%m/%Y %H:%M')
|
||||||
end
|
end
|
||||||
|
@ -20,16 +14,6 @@ class DossierDecorator < Draper::Decorator
|
||||||
DossierDecorator.case_state_fr state
|
DossierDecorator.case_state_fr state
|
||||||
end
|
end
|
||||||
|
|
||||||
def class_qp_active
|
|
||||||
'qp' if procedure.module_api_carto.quartiers_prioritaires
|
|
||||||
end
|
|
||||||
|
|
||||||
def state_color_class
|
|
||||||
return 'text-danger' if waiting_for_gestionnaire?
|
|
||||||
return 'text-info' if waiting_for_user?
|
|
||||||
return 'text-success' if termine?
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.case_state_fr state=self.state
|
def self.case_state_fr state=self.state
|
||||||
h.t("activerecord.attributes.dossier.state.#{state}")
|
h.t("activerecord.attributes.dossier.state.#{state}")
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe DossierDecorator do
|
describe DossierDecorator do
|
||||||
let(:dossier) { create(:dossier, updated_at: Time.new(2015, 12, 24, 14, 10)) }
|
let(:dossier) { create(:dossier, created_at: Time.new(2015, 12, 24, 14, 10), updated_at: Time.new(2015, 12, 24, 14, 10)) }
|
||||||
subject { dossier.decorate }
|
subject { dossier.decorate }
|
||||||
|
|
||||||
|
describe 'created_at' do
|
||||||
|
subject { super().created_at }
|
||||||
|
it { is_expected.to eq('24/12/2015 14:10') }
|
||||||
|
end
|
||||||
|
|
||||||
describe 'last_update' do
|
describe 'last_update' do
|
||||||
subject { super().last_update }
|
subject { super().last_update }
|
||||||
it { is_expected.to eq('24/12/2015 14:10') }
|
it { is_expected.to eq('24/12/2015 14:10') }
|
||||||
|
|
Loading…
Reference in a new issue