Skip to content

Commit

Permalink
Merge pull request #350 from alfajango/deleted-user-activities
Browse files Browse the repository at this point in the history
Fixed issue with gravatar_url for user that no longer exists.
  • Loading branch information
scouttyg committed May 7, 2014
2 parents ffa3a71 + 8ea667a commit 3cbfae7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/activities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def index
# NOTE if the action is accessed then there's definitely activities, so skip check for #first to be nil
more_activities = first_activity_id < (activities.last.try(:id).presence || 1)

activities.each { |a| a.user ||= User.deleted_user }

respond_to do |format|
format.json { render :text => {:activities => activities.reverse, :more_activities => more_activities }.to_json(:include => :user) }
end
Expand Down

0 comments on commit 3cbfae7

Please sign in to comment.