aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/line_referential_sync.rb
diff options
context:
space:
mode:
authorXinhui2016-10-03 14:27:31 +0200
committerXinhui2016-10-03 16:33:21 +0200
commit5d6802c6eb0b78466a6bd1b176bfc380918c2fee (patch)
treebf547ff60d24ab492b9a0fbd25e4949d9e4f8e1e /app/models/line_referential_sync.rb
parenta3ec27a8d971f6886712a0b19e4dbd85693882e0 (diff)
downloadchouette-core-5d6802c6eb0b78466a6bd1b176bfc380918c2fee.tar.bz2
Add cancel sync button for testing
Diffstat (limited to 'app/models/line_referential_sync.rb')
-rw-r--r--app/models/line_referential_sync.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/line_referential_sync.rb b/app/models/line_referential_sync.rb
index 03fea6a97..7d0c1ba1f 100644
--- a/app/models/line_referential_sync.rb
+++ b/app/models/line_referential_sync.rb
@@ -6,6 +6,10 @@ class LineReferentialSync < ActiveRecord::Base
after_commit :perform_sync, :on => :create
validate :multiple_process_validation, :on => :create
+ def can_be_canceled?
+ [:new, :pending].include? self.status.to_sym
+ end
+
private
def perform_sync
create_sync_message :info, :new