diff options
| author | Xinhui | 2016-09-26 17:15:46 +0200 |
|---|---|---|
| committer | Xinhui | 2016-09-27 10:56:48 +0200 |
| commit | 8c378fe9c6299ac9400ff6898702b7e0c6a64799 (patch) | |
| tree | 89bd93e6bc2e5d4752020c599e1b479a89b3c1c7 /app/models/line_referential_sync.rb | |
| parent | 56c51faf52b824afd2057194233f357e8d5330ae (diff) | |
| download | chouette-core-8c378fe9c6299ac9400ff6898702b7e0c6a64799.tar.bz2 | |
Wip gem sidekiq && LineReferentialSyncWorker
Refs #1707
Diffstat (limited to 'app/models/line_referential_sync.rb')
| -rw-r--r-- | app/models/line_referential_sync.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/app/models/line_referential_sync.rb b/app/models/line_referential_sync.rb index 763936f3b..35e074d4e 100644 --- a/app/models/line_referential_sync.rb +++ b/app/models/line_referential_sync.rb @@ -1,10 +1,9 @@ class LineReferentialSync < ActiveRecord::Base belongs_to :line_referential + after_create :synchronize - has_many :line_sync_operations, dependent: :destroy - - def record_status status, message - line_sync_operations << LineSyncOperation.new(status: status, message: message) - line_sync_operations.first.destroy while line_sync_operations.count > 30 + private + def synchronize + LineReferentialSyncWorker.perform_async(self.id) end end |
