diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-03-24 17:00:26 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-04-01 11:13:48 +0200 |
commit | 84b0ab77667b85a42db8a5a02d9758657af66f16 (patch) | |
tree | 5058f048563c8d8e8be4b7e0837d919ff0a878d4 /lib/api/entities.rb | |
parent | 82539cff700931532b22b6a8e3d6832137fc5d55 (diff) | |
download | gitlab-ce-routing.tar.gz |
Added & use Gitlab::Routing for URL helpersrouting
Rails' "url_helpers" method creates an anonymous Module (which a bunch
of methods) on every call. By caching the output of this method in a
dedicated method we can shave off about 10 seconds of loading time for
an issue with around 200 comments.
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index f686c568bee..c452aed27df 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -8,7 +8,7 @@ module API expose :id, :state, :avatar_url expose :web_url do |user, options| - Gitlab::Application.routes.url_helpers.user_url(user) + Gitlab::Routing.url_helpers.user_url(user) end end @@ -89,7 +89,7 @@ module API expose :avatar_url expose :web_url do |group, options| - Gitlab::Application.routes.url_helpers.group_url(group) + Gitlab::Routing.url_helpers.group_url(group) end end |