Skip to content

Commit

Permalink
Merge pull request #1003 from transitland/stop-distances-nil-fix
Browse files Browse the repository at this point in the history
updating ssp distances for non-import changesets
  • Loading branch information
irees authored Mar 3, 2017
2 parents 8aef5d5 + 80b5fc3 commit db2b260
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/models/changeset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,14 @@ def post_quality_check_updates
if Issue.issues_of_entity(rsp).any?{ |issue| issue.issue_type.eql?('distance_calculation_inaccurate') }
rsp.stop_distances = Array.new(rsp.stop_pattern.size)
rsp.update_making_history(changeset: self)
unless import?
rsp.ordered_ssp_trip_chunks { |trip_chunk|
trip_chunk.each_with_index do |ssp, i|
ssp.update_column(:origin_dist_traveled, rsp.stop_distances[i])
ssp.update_column(:destination_dist_traveled, rsp.stop_distances[i+1])
end
}
end
end
end
end
Expand Down

0 comments on commit db2b260

Please sign in to comment.