aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks/codifligne.rake
blob: dd5e99370c61945081ca262ccd957e5765012b70 (plain)
1
2
3
4
5
6
7
8
namespace :codifligne do
  desc "Sync lines, companies, networks, and group of lines from codifligne"
  task sync: :environment  do
    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
end