aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks
diff options
context:
space:
mode:
authorjpl2017-04-26 16:20:57 +0200
committerRobert2017-04-27 10:42:03 +0200
commit989d21f6b0604b9dd748135bc2f9e1be6ae24507 (patch)
tree5f6b4930f5c16eb7963939c7c904464c535bce74 /lib/tasks
parent80e3a03364b93c752048c535dd9af7e906c6f146 (diff)
downloadchouette-core-989d21f6b0604b9dd748135bc2f9e1be6ae24507.tar.bz2
more information into output of rake referential:create
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/referential.rake5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/tasks/referential.rake b/lib/tasks/referential.rake
index 9d98a048b..c89cd3f7a 100644
--- a/lib/tasks/referential.rake
+++ b/lib/tasks/referential.rake
@@ -15,7 +15,9 @@ namespace :referential do
ReferentialMetadata.create!(referential: referential, line_ids: [args[:line_id]], periodes: [Date.parse(args[:start_date])..Date.parse(args[:end_date])])
referential.switch
- puts "✓ Created Referential '#{name}' (#{referential.id})"
+
+ print "✓ Created Referential ".green, name, "(#{referential.id})".blue, " switched to schema: ", referential.slug.yellow, "\n"
+ puts " For inspection of data in the console, do a: `Referential.last.switch'".blueish
stop_areas = workbench.stop_area_referential.stop_areas.last(10)
@@ -32,6 +34,7 @@ namespace :referential do
route.stop_areas = stop_areas.reverse
end
route.save!
+ print " ✓ Created Route ".green, route.name, "(#{route.id}), ".blue, "Line (#{line.id}) has #{line.routes.count} routes\n"
journey_pattern = Chouette::JourneyPattern.create!(route: route, name: "Journey Pattern #{Faker::Name.unique.name}")
journey_pattern.stop_points = stop_areas.inject([]) { |stop_points, stop_area| stop_points += stop_area.stop_points }