myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3574] trunk/app: Fix for activity feed breaking


From: noreply
Subject: [myexperiment-hackers] [3574] trunk/app: Fix for activity feed breaking when group-policy shared items are deleted
Date: Wed, 29 May 2013 08:53:02 +0000 (UTC)

Revision
3574
Author
fbacall
Date
2013-05-29 08:53:02 +0000 (Wed, 29 May 2013)

Log Message

Fix for activity feed breaking when group-policy shared items are deleted

Modified Paths

Diff

Modified: trunk/app/controllers/application_controller.rb (3573 => 3574)


--- trunk/app/controllers/application_controller.rb	2013-05-28 15:51:23 UTC (rev 3573)
+++ trunk/app/controllers/application_controller.rb	2013-05-29 08:53:02 UTC (rev 3574)
@@ -300,7 +300,7 @@
     # Work out which groups have view access after the changes were made and
     # generate activities for them.
 
-    contributable.contribution.policy.permissions.find(:all, :conditions => conditions).each do |permission|
+    contributable.contribution.policy.reload.permissions.find(:all, :conditions => conditions).each do |permission|
       next if old_groups.include?(permission.contributor)
       Activity.create_activities(:subject => user, :action ="" 'create', :object => permission, :contributable => contributable)
     end

Modified: trunk/app/helpers/activities_helper.rb (3573 => 3574)


--- trunk/app/helpers/activities_helper.rb	2013-05-28 15:51:23 UTC (rev 3573)
+++ trunk/app/helpers/activities_helper.rb	2013-05-29 08:53:02 UTC (rev 3574)
@@ -5,7 +5,7 @@
 
 module ActivitiesHelper
 
-  def activity_link(activity, source)
+  def activity_link(activity, source, label = nil)
 
     case source
     when :subject
@@ -19,7 +19,7 @@
       label = activity.context.label
     when :auth
       thing = activity.auth
-      label = activity.auth.label
+      label ||= activity.auth.label
     end
 
     thing = thing.versioned_resource if thing.respond_to?(:versioned_resource)
@@ -253,7 +253,7 @@
     when "Membership create"
       "#{sentence(activity_set.map { |a| activity_link(a, :subject) })} joined the #{activity_link(activity, :context)} group"
     when "Permission create"
-      "#{activity_link(activity, :subject)} shared #{activity_link(activity, :auth)}"
+      "#{activity_link(activity, :subject)} shared #{activity_link(activity, :auth, activity.objekt_label)}"
     when "FeedItem create"
       link_to(strip_tags(activity.objekt.title), activity.objekt.link, :rel => "nofollow")
     when "GroupAnnouncement create"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]