Commit c98301d75928544e927be30b3a95b9445e1c5249
Exists in
master
and in
4 other branches
Merge pull request #81 from ariejan/fix_for_dashboard_grit_commit
Show commits as 'Commit' instead of 'Grit::Commit'
Showing
1 changed file
with
6 additions
and
3 deletions
Show diff stats
app/helpers/dashboard_helper.rb
| ... | ... | @@ -19,12 +19,15 @@ module DashboardHelper |
| 19 | 19 | end |
| 20 | 20 | |
| 21 | 21 | def dashboard_feed_title(object) |
| 22 | - title = case object.class.name.to_s | |
| 22 | + klass = object.class.to_s.split("::").last | |
| 23 | + | |
| 24 | + title = case klass | |
| 23 | 25 | when "Note" then markdown(object.note) |
| 24 | 26 | when "Issue" then object.title |
| 25 | - when "Grit::Commit" then object.safe_message | |
| 27 | + when "Commit" then object.safe_message | |
| 26 | 28 | else "" |
| 27 | 29 | end |
| 28 | - "[#{object.class.name}] #{truncate(sanitize(title, :tags => []), :length => 60)} " | |
| 30 | + | |
| 31 | + "[#{klass}] #{truncate(sanitize(title, :tags => []), :length => 60)} " | |
| 29 | 32 | end |
| 30 | 33 | end | ... | ... |