Skip to content

Commit

Permalink
In order to log activity for guest users we should logged all activit…
Browse files Browse the repository at this point in the history
…ies as long as we are given a valid actor, not just if there is a user logged in.
  • Loading branch information
Will Fisher committed Dec 1, 2008
1 parent ad1aa21 commit 5e49091
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/activity_streams/log_activity_streams.rb
Expand Up @@ -49,7 +49,7 @@ def write_activity_stream_log(actor_method, actor_name, verb, object_method,

return unless action == self.action_name.to_sym

return if !flash[:error].blank? || !logged_in? || @suppress_activity_stream
return if !flash[:error].blank? || @suppress_activity_stream

status = options[:status] || 0

Expand All @@ -58,15 +58,16 @@ def write_activity_stream_log(actor_method, actor_name, verb, object_method,
else
actors = self.send(actor_method) || []
end
actors = [ actors ] unless actors.is_a? Array
return if actors.empty?

if object_method.to_s.start_with?('@')
objects = self.instance_variable_get(object_method) || []
else
objects = self.send(object_method) || []
end
actors = [ actors ] unless actors.is_a? Array
objects = [ objects ] unless objects.is_a? Array


if indirect_object_method = options[:indirect_object]
if indirect_object_method.to_s.start_with?('@')
indirect_object = self.instance_variable_get(indirect_object_method)
Expand Down

0 comments on commit 5e49091

Please sign in to comment.