OSDN Git Service

Show commits as 'Commit' instead of 'Grit::Commit'
authorAriejan de Vroom <ariejan@ariejan.net>
Wed, 9 Nov 2011 15:59:51 +0000 (16:59 +0100)
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>
Wed, 9 Nov 2011 18:52:20 +0000 (20:52 +0200)
Conflicts:

app/helpers/dashboard_helper.rb

app/helpers/dashboard_helper.rb

index 03f6a01..422097d 100644 (file)
@@ -19,12 +19,15 @@ module DashboardHelper
   end
 
   def dashboard_feed_title(object)
-    title = case object.class.name.to_s
+    klass = object.class.to_s.split("::").last
+
+    title = case klass
             when "Note" then markdown(object.note)
             when "Issue" then object.title
-            when "Grit::Commit" then object.safe_message
+            when "Commit" then object.safe_message
             else return "Project Wall"
             end
-    "[#{object.class.name}] #{truncate(sanitize(title, :tags => []), :length => 60)} "
+
+    "[#{klass}] #{truncate(sanitize(title, :tags => []), :length => 60)} "
   end
 end