summaryrefslogtreecommitdiff
path: root/app/helpers/events_helper.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-11-13 00:15:33 +0100
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-11-13 00:15:33 +0100
commitbcc82511966aba863a0a912302e8cfe3368ebc32 (patch)
treec588464b4b93ae3729d7245f0acfd67fde818c0e /app/helpers/events_helper.rb
parent857710634c516cea8516e73132027a361364211c (diff)
downloadgitlab-ce-bcc82511966aba863a0a912302e8cfe3368ebc32.tar.gz
Split complex method EventsHelper#event_feed_url.
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers/events_helper.rb')
-rw-r--r--app/helpers/events_helper.rb26
1 files changed, 15 insertions, 11 deletions
diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb
index 51b872b7a95..dde83ff36b5 100644
--- a/app/helpers/events_helper.rb
+++ b/app/helpers/events_helper.rb
@@ -108,19 +108,23 @@ module EventsHelper
end
end
elsif event.push?
- if event.push_with_commits? && event.md_ref?
- if event.commits_count > 1
- namespace_project_compare_url(event.project.namespace, event.project,
- from: event.commit_from, to:
- event.commit_to)
- else
- namespace_project_commit_url(event.project.namespace, event.project,
- id: event.commit_to)
- end
+ push_event_feed_url(event)
+ end
+ end
+
+ def push_event_feed_url(event)
+ if event.push_with_commits? && event.md_ref?
+ if event.commits_count > 1
+ namespace_project_compare_url(event.project.namespace, event.project,
+ from: event.commit_from, to:
+ event.commit_to)
else
- namespace_project_commits_url(event.project.namespace, event.project,
- event.ref_name)
+ namespace_project_commit_url(event.project.namespace, event.project,
+ id: event.commit_to)
end
+ else
+ namespace_project_commits_url(event.project.namespace, event.project,
+ event.ref_name)
end
end