Simpler arguments passed to named_route on toggle_award_url helper method
This commit is contained in:
parent
44f718c9a0
commit
325a5bafcc
2 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
Please view this file on the master branch, on stable branches it's out of date.
|
Please view this file on the master branch, on stable branches it's out of date.
|
||||||
|
|
||||||
## 8.14.0 (2016-11-22)
|
## 8.14.0 (2016-11-22)
|
||||||
|
- Simpler arguments passed to named_route on toggle_award_url helper method
|
||||||
|
|
||||||
## 8.13.0 (2016-10-22)
|
## 8.13.0 (2016-10-22)
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ module AwardEmojiHelper
|
||||||
return url_for([:toggle_award_emoji, awardable]) unless @project
|
return url_for([:toggle_award_emoji, awardable]) unless @project
|
||||||
|
|
||||||
if awardable.is_a?(Note)
|
if awardable.is_a?(Note)
|
||||||
# We render a list of notes very frequently and calling the specific method is a lot faster than the generic one (6.5x)
|
# We render a list of notes very frequently and calling the specific method is a lot faster than the generic one (4.5x)
|
||||||
toggle_award_emoji_namespace_project_note_url(namespace_id: @project.namespace, project_id: @project, id: awardable.id)
|
toggle_award_emoji_namespace_project_note_url(@project.namespace, @project, awardable.id)
|
||||||
else
|
else
|
||||||
url_for([:toggle_award_emoji, @project.namespace.becomes(Namespace), @project, awardable])
|
url_for([:toggle_award_emoji, @project.namespace.becomes(Namespace), @project, awardable])
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue