blob: d48ddbba4f3b133b48c3839bc8a7b4da9f325a39 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
namespace :route_sections do
def find_referential(id_or_slug)
if id_or_slug.to_s =~ /\A\d+\Z/
Referential.find id_or_slug.to_i
else
Referential.find_by slug: id_or_slug
end
end
desc "Generate all RouteSections for a given Referential"
task :create_all, [:referential] => [:environment] do |t, args|
find_referential(args[:referential]).switch
OsrmRouteSectionProcessor.create_all
end
end
|