Skip to content

Commit

Permalink
Merge pull request #683 from ArnaudOggy/use_schedule_id_for_equipment
Browse files Browse the repository at this point in the history
[feature] Use schedule_prefix for equipment
  • Loading branch information
datanel authored Jul 31, 2020
2 parents 1e46a1a + 7e0b364 commit 878c08c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Kisio Digital <[email protected]>", "Guillaume Pinot <[email protected]>"]
name = "transit_model"
version = "0.26.0"
version = "0.26.1"
license = "AGPL-3.0-only"
description = "Transit data management"
repository = "https://github.com/CanalTP/transit_model"
Expand Down
10 changes: 5 additions & 5 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ impl AddPrefix for StopArea {
self.equipment_id = self
.equipment_id
.take()
.map(|id| prefix_conf.referential_prefix(id.as_str()));
.map(|id| prefix_conf.schedule_prefix(id.as_str()));
self.geometry_id = self
.geometry_id
.take()
Expand Down Expand Up @@ -1115,7 +1115,7 @@ impl AddPrefix for StopPoint {
self.equipment_id = self
.equipment_id
.take()
.map(|id| prefix_conf.referential_prefix(id.as_str()));
.map(|id| prefix_conf.schedule_prefix(id.as_str()));
self.geometry_id = self
.geometry_id
.take()
Expand Down Expand Up @@ -1172,7 +1172,7 @@ impl AddPrefix for StopLocation {
self.equipment_id = self
.equipment_id
.take()
.map(|id| prefix_conf.referential_prefix(id.as_str()));
.map(|id| prefix_conf.schedule_prefix(id.as_str()));
self.level_id = self
.level_id
.take()
Expand Down Expand Up @@ -1404,7 +1404,7 @@ impl_id!(Equipment);

impl AddPrefix for Equipment {
fn prefix(&mut self, prefix_conf: &PrefixConfiguration) {
self.id = prefix_conf.referential_prefix(self.id.as_str());
self.id = prefix_conf.schedule_prefix(self.id.as_str());
}
}

Expand Down Expand Up @@ -1439,7 +1439,7 @@ impl AddPrefix for Transfer {
self.equipment_id = self
.equipment_id
.take()
.map(|id| prefix_conf.referential_prefix(id.as_str()));
.map(|id| prefix_conf.schedule_prefix(id.as_str()));
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/gtfs2ntfs/full_output/equipments.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
equipment_id,wheelchair_boarding,sheltered,elevator,escalator,bike_accepted,bike_depot,visual_announcement,audible_announcement,appropriate_escort,appropriate_signage
ME:0,1,0,0,0,0,0,0,0,0,0
ME:Defaul:0,1,0,0,0,0,0,0,0,0,0
2 changes: 1 addition & 1 deletion tests/fixtures/gtfs2ntfs/full_output/stops.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
stop_id,stop_name,stop_code,visible,fare_zone_id,stop_lon,stop_lat,location_type,parent_station,stop_timezone,geometry_id,equipment_id,level_id,platform_code
ME:stop:11,pouet,,1,,2.372987,48.844746,0,ME:stoparea:1,,,ME:0,ME:1,A
ME:stop:11,pouet,,1,,2.372987,48.844746,0,ME:stoparea:1,,,ME:Defaul:0,ME:1,A
ME:stop:22,pouet,,1,,2.372987,48.844746,0,ME:stoparea:1,,,,,
ME:stop:31,pouet,,1,,2.372987,48.844746,0,ME:stoparea:1,,,,,
ME:stop:32,pouet,,1,,2.372987,48.844746,0,ME:stoparea:1,,,,,
Expand Down

0 comments on commit 878c08c

Please sign in to comment.