diff options
| author | Xinhui | 2016-09-27 15:49:04 +0200 | 
|---|---|---|
| committer | Xinhui | 2016-09-27 16:01:47 +0200 | 
| commit | 2d6fa24975ac5a3d28e657a96a781db1cb17d56c (patch) | |
| tree | 66101505db30cd3100fbba63bf13d4cbcf4f4990 /lib/tasks | |
| parent | 12f506a82ae9099cface5b9507dd8a36bf923508 (diff) | |
| download | chouette-core-2d6fa24975ac5a3d28e657a96a781db1cb17d56c.tar.bz2 | |
Refactoring rake codifligne:sync
Refs #1707
Diffstat (limited to 'lib/tasks')
| -rw-r--r-- | lib/tasks/codifligne.rake | 5 | 
1 files changed, 4 insertions, 1 deletions
| diff --git a/lib/tasks/codifligne.rake b/lib/tasks/codifligne.rake index 8b7a4f669..f306ee484 100644 --- a/lib/tasks/codifligne.rake +++ b/lib/tasks/codifligne.rake @@ -1,6 +1,9 @@  namespace :codifligne do    desc "Sync lines, companies, networks, and group of lines from codifligne"    task sync: :environment  do -    Stif::CodifLineSynchronization.synchronize +    lref      = LineReferential.find_by(name: 'CodifLigne') +    lref_sync = LineReferentialSync.create(line_referential: lref) +    raise "Codifligne:sync aborted - an sync is already running" unless lref_sync.valid? +    lref_sync.save if lref_sync.valid?    end  end | 
