Commit 1924de91c58a429452edd97b181520abd9968bf7

Authored by Dmitriy Zaporozhets
1 parent f6f939ee

fixed compare for push

app/models/commit.rb
@@ -56,4 +56,8 @@ class Commit @@ -56,4 +56,8 @@ class Commit
56 def prev_commit 56 def prev_commit
57 parents.first 57 parents.first
58 end 58 end
  59 +
  60 + def prev_commit_id
  61 + prev_commit.id
  62 + end
59 end 63 end
app/views/dashboard/_events_feed.html.haml
@@ -12,8 +12,8 @@ @@ -12,8 +12,8 @@
12 = time_ago_in_words(event.created_at) 12 = time_ago_in_words(event.created_at)
13 ago. 13 ago.
14 - if event.commits.count > 1 14 - if event.commits.count > 1
15 - = link_to compare_project_commits_path(event.project, :from => event.commits.last, :to => event.commits.first) do  
16 - Compare #{event.commits.last.id[0..8]}...#{event.commits.first.id[0..8]} 15 + = link_to compare_project_commits_path(event.project, :from => event.commits.first.prev_commit_id, :to => event.commits.last.id) do
  16 + Compare #{event.commits.first.commit.id[0..8]}...#{event.commits.last.id[0..8]}
17 - @project = event.project 17 - @project = event.project
18 %ul.unstyled 18 %ul.unstyled
19 = render event.commits 19 = render event.commits