Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions script/candidate_info.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env ruby

# Outputs a JSON format of candidate names, local addresses, and permanent
# addresses as well as expected graduation semesters.
# - jkhoe

# Trick Ruby into loading all of our Rails configurations
# Note: You MUST have the environment variable $RAILS_ENV set to 'production'
require File.expand_path('../../config/environment', __FILE__)

candidate_group = Group.find_by_name("candidates")

puts '['
candidate_group.people.where(:approved => true).each do |person|
info = '["' + person.full_name + '","' + person.local_address + '","' + person.perm_address + '","' + person.grad_semester + '"],'
puts info
end
puts ']'