dblock / slack-strava

(Re)Post Strava activities to Slack
https://slava.playplay.io
MIT License
37 stars 6 forks source link

A deactivated team that subscribes for the first time isn't reactivated #158

Open dblock opened 9 months ago

dblock commented 9 months ago
  1. Team on trial
  2. Trial expires, team deactivated
  3. Subscribe
  4. Team is not re-activated but marked as subscribed

Also related, https://github.com/dblock/slack-strava/issues/134.

dblock commented 9 months ago
total = 0
Team.no_timeout.active.each do |team|
  next unless team.activities.unbragged.any?
  puts "#{team}"
  team.users.each do |user|
    next unless user.activities.unbragged.any?
    puts " #{user}: #{user.activities.unbragged.count}"
    total += user.activities.unbragged.count
  end
  team.clubs.each do |club|
    next unless club.activities.unbragged.any?
    puts " club_id=#{club.strava_id}, name=#{club.name}: #{club.activities.unbragged.count}"
    total += club.activities.unbragged.count
  end
end; puts "total=#{total}"; nil