console_scripts.rb
# Count all accepted talks by track
Count all accepted talks by track
Count all accepted talks by track
def track_info
  @conference = Conference.find_by_acronym('jct2018')
  @tracks = @conference.tracks
  s = ""
  total_count = 0
  @tracks.each do |t|
      track_count = @conference.events.accepted.find_all_by_track_id(t.id).count
      s << "Track: #{t.name}, accepted: #{track_count} \n"
      total_count += track_count
  end
  puts s
  puts "total_count #{total_count}"
  end
def track_info @conference = Conference . find_by_acronym ( 'jct2018' ) @tracks = @conference . tracks s = "" total_count = 0 @tracks . each do | t | track_count = @conference . events . accepted . find_all_by_track_id ( t . id ) . count s << "Track: #{t.name}, accepted: #{track_count} \n" total_count += track_count end puts s puts "total_count #{total_count}" end
Count all accepted talks by track
Count all accepted talks by track