def count_duplicate_activities(activity, after)
      entities = { }

      activity.entities.each do |entity_name, entity|
        entities[entity_name.to_sym] = entity.model_id
      end

      self.count_activities({
        :only     => activity.class,
        :entities => entities,
        :after    => after,
      })
    end
def count_duplicate_activities(activity, after)
      entities = { }

      activity.entities.each do |entity_name, entity|
        entities[entity_name.to_sym] = entity.model_id
      end

      self.count_activities({
        :only     => activity.class,
        :entities => entities,
        :after    => after,
      })
    end
Find number of duplicate activities

 @param activity [Activity] Activity to search
 @param after [Time] Search after that datetime
 @return [Integer] Number of activity duplicates