From 5dedb1352f274113e97a2554d9249e56a865a4bf Mon Sep 17 00:00:00 2001 From: Xinhui Date: Thu, 29 Sep 2016 15:25:37 +0200 Subject: Add started_at, ended_at, status to stop_area_referential_syncs Refs #1710 --- app/models/stop_area_referential_sync.rb | 6 ------ app/models/stop_area_sync_operation.rb | 3 --- app/views/stop_area_referentials/show.html.slim | 12 ++++++------ 3 files changed, 6 insertions(+), 15 deletions(-) delete mode 100644 app/models/stop_area_sync_operation.rb (limited to 'app') diff --git a/app/models/stop_area_referential_sync.rb b/app/models/stop_area_referential_sync.rb index 3a9b2d03b..54a3fce46 100644 --- a/app/models/stop_area_referential_sync.rb +++ b/app/models/stop_area_referential_sync.rb @@ -1,9 +1,3 @@ class StopAreaReferentialSync < ActiveRecord::Base belongs_to :stop_area_referential - has_many :stop_area_sync_operations, dependent: :destroy - - def record_status status, message - stop_area_sync_operations << StopAreaSyncOperation.new(status: status, message: message) - stop_area_sync_operations.first.destroy while stop_area_sync_operations.count > 30 - end end diff --git a/app/models/stop_area_sync_operation.rb b/app/models/stop_area_sync_operation.rb deleted file mode 100644 index ca0fde4db..000000000 --- a/app/models/stop_area_sync_operation.rb +++ /dev/null @@ -1,3 +0,0 @@ -class StopAreaSyncOperation < ActiveRecord::Base - belongs_to :stop_area_referential_sync -end diff --git a/app/views/stop_area_referentials/show.html.slim b/app/views/stop_area_referentials/show.html.slim index 32fe950dc..761393013 100644 --- a/app/views/stop_area_referentials/show.html.slim +++ b/app/views/stop_area_referentials/show.html.slim @@ -9,12 +9,12 @@ span.badge = @stop_area_referential.stop_areas.size = link_to Referential.human_attribute_name("stop_areas"), stop_area_referential_stop_areas_path(@stop_area_referential) -- unless @stop_area_referential.stop_area_referential_sync.stop_area_sync_operations.empty? - h3 Historique des synchronisations +/ - unless @stop_area_referential.stop_area_referential_sync.stop_area_sync_operations.empty? +/ h3 Historique des synchronisations - ul.list-group width="75%" - - @stop_area_referential.stop_area_referential_sync.stop_area_sync_operations.each do |sync| - li = "#{sync.created_at.to_formatted_s(:short)} - #{sync.message}" +/ ul.list-group width="75%" +/ - @stop_area_referential.stop_area_referential_sync.stop_area_sync_operations.each do |sync| +/ li = "#{sync.created_at.to_formatted_s(:short)} - #{sync.message}" - content_for :sidebar do - ul.actions \ No newline at end of file + ul.actions -- cgit v1.2.3