Also inject new route helpers into includers of GitlabRoutingHelper
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/34859
Before:
[1] pry(main)> ApplicationController
=> ApplicationController
[2] pry(main)> module Foo; def foo; 'foo'; end; end
=> :foo
[3] pry(main)> Gitlab::Routing.add_helpers(Foo)
=> [JiraService(id: integer, type: string, title: string, project_id: integer, created_at: datetime, updated_at: datetime, active: boolean, properties: text, template: boolean, push_events: boolean, issues_events: boolean, merge_requests_events: boolean, tag_push_events: boolean, note_events: boolean, category: string, default: boolean, wiki_page_events: boolean, pipeline_events: boolean, confidential_issues_events: boolean, commit_events: boolean, job_events: boolean)]
[4] pry(main)> ApplicationController.new.foo
NoMethodError: undefined method `foo' for #<ApplicationController:0x007f7f502d32b0>
from (pry):4:in `<main>'
[5] pry(main)>
After:
[1] pry(main)> ApplicationController
=> ApplicationController
[2] pry(main)> module Foo; def foo; 'foo'; end; end
=> :foo
[3] pry(main)> Gitlab::Routing.add_helpers(Foo)
=> [JiraService(id: integer, type: string, title: string, project_id: integer, created_at: datetime, updated_at: datetime, active: boolean, properties: text, template: boolean, push_events: boolean, issues_events: boolean, merge_requests_events: boolean, tag_push_events: boolean, note_events: boolean, category: string, default: boolean, wiki_page_events: boolean, pipeline_events: boolean, confidential_issues_events: boolean, commit_events: boolean, job_events: boolean),
IssuablesHelper,
#<Module:0x007fc50e3c4e40>,
ApplicationController]
[4] pry(main)> ApplicationController.new.foo
=> "foo"
[5] pry(main)>
/cc @stanhu @marin @smcgivern
Edited by Douwe Maan