Commit bcc82511 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Split complex method EventsHelper#event_feed_url.

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 85771063
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment