From c91a0c34d1218b67e5aaca96f1140734baf7b7ec Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 7 Jul 2017 12:40:48 +0200 Subject: TableBuilderHelper::URL: Fix polymorphic URL for TimeTable Had a problem on the TimeTables#index page where the #show and #edit links in the gear menu would link to `/referentials/:id` instead of `/referentials/:id/time_tables/:id`. This turned out to be caused by a syntax bug in the condition that adds the `Chouette::TimeTable` object to the polymorphic URL array. Now the proper URL is rendered. Refs #3479 --- app/helpers/table_builder_helper/url.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/table_builder_helper/url.rb b/app/helpers/table_builder_helper/url.rb index 894e5ddf8..0894df0fe 100644 --- a/app/helpers/table_builder_helper/url.rb +++ b/app/helpers/table_builder_helper/url.rb @@ -10,7 +10,7 @@ module TableBuilderHelper polymorph_url << item.route.line if item.is_a?(Chouette::RoutingConstraintZone) polymorph_url << item if item.respond_to? :line_referential polymorph_url << item.stop_area if item.respond_to? :stop_area - polymorph_url << item if item.respond_to? :stop_points || item.is_a?(Chouette::TimeTable) + polymorph_url << item if item.respond_to?(:stop_points) || item.is_a?(Chouette::TimeTable) elsif item.respond_to? :referential polymorph_url << item.referential end -- cgit v1.2.3