diff options
Diffstat (limited to 'lib/tasks/codifligne.rake')
| -rw-r--r-- | lib/tasks/codifligne.rake | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/tasks/codifligne.rake b/lib/tasks/codifligne.rake index 4a108f789..dd5e99370 100644 --- a/lib/tasks/codifligne.rake +++ b/lib/tasks/codifligne.rake @@ -1,8 +1,7 @@ namespace :codifligne do desc "Sync lines, companies, networks, and group of lines from codifligne" task sync: :environment do - lref = LineReferential.find_by(name: 'CodifLigne') - sync = lref.line_referential_syncs.build + sync = LineReferential.find_by(name: 'CodifLigne').line_referential_syncs.build raise "Codifligne:sync aborted - There is already an synchronisation in progress" unless sync.valid? sync.save if sync.valid? end |
