diff options
| author | Xinhui | 2016-09-29 11:43:48 +0200 | 
|---|---|---|
| committer | Xinhui | 2016-09-29 11:43:48 +0200 | 
| commit | f5a4f5056ccb72d6b097594298581f8bb1400dba (patch) | |
| tree | 45f1f20d9afca530492be76cef7123b655e81c6d /lib/tasks | |
| parent | 1d84e1ded90688fee6ad80bb4f53c861552e3b68 (diff) | |
| download | chouette-core-f5a4f5056ccb72d6b097594298581f8bb1400dba.tar.bz2 | |
Launch sync from interface
Refs #1708
Diffstat (limited to 'lib/tasks')
| -rw-r--r-- | lib/tasks/codifligne.rake | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/lib/tasks/codifligne.rake b/lib/tasks/codifligne.rake index f306ee484..4a108f789 100644 --- a/lib/tasks/codifligne.rake +++ b/lib/tasks/codifligne.rake @@ -1,9 +1,9 @@  namespace :codifligne do    desc "Sync lines, companies, networks, and group of lines from codifligne"    task sync: :environment  do -    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? +    lref = LineReferential.find_by(name: 'CodifLigne') +    sync = lref.line_referential_syncs.build +    raise "Codifligne:sync aborted - There is already an synchronisation in progress" unless sync.valid? +    sync.save if sync.valid?    end  end | 
