aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks/codifligne.rake
blob: 4a108f7898745d330e997e595197fa808e66c341 (plain)
1
2
3
4
5
6
7
8
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')
    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