%span.timestamp
  = activity.created_at.to_s(:pretty)
%p{ :class => activity.key.parameterize }

  - classroom_link = link_to(_('classroom'), root_url(:subdomain => activity.recipient.slug))

  - if activity.trackable and activity.trackable.user == p[:current_user]
    - name = _('you')
  - else
    - name = activity.trackable.user.name

  - if activity.owner == p[:current_user]
    = _('You added %s to %s members.' % [name, classroom_link])
  - else
    = _('%s added %s to %s members.' % [activity.owner.name, name, classroom_link])
%hr


%span.timestamp
  = activity.created_at.to_s(:pretty)
%p{ :class => activity.key.parameterize }

  - classroom_link = link_to(_('classroom'), root_url(:subdomain => activity.recipient.slug))

  - if activity.trackable and activity.trackable.user == p[:current_user]
    - name = _('you')
  - else
    - name = activity.parameters[:user_name]

  - if activity.owner == p[:current_user]
    = _('You added %s to %s members.' % [name, classroom_link])
  - else
    = _('%s added %s to %s members.' % [activity.owner.name, name, classroom_link])
%hr


Use cached parameter instead of calling the deleted object.
Use cached parameter instead of calling the deleted object.