Skip to content

Commit

Permalink
clean up qualification, but it is still not working as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepmunroe committed Mar 27, 2013
1 parent 42f05f5 commit 04bc8fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/controllers/wicked_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class WickedController < ApplicationController
def index
athletes = Athlete.where(:affiliate => 'wicked').order('total asc')
athletes = Athlete.where(:affiliate => 'wicked').order('qualified asc')
male_athletes = athletes.where(:gender => 'Male')
female_athletes = athletes.where(:gender => 'Female')
@individual_men = male_athletes.where('age < 40')
Expand Down
11 changes: 1 addition & 10 deletions app/models/athlete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,14 @@ def self.qualify

scores.each do |value|
puts value
if (value.match(/\d*\d/))
match = value.match(/\d*\d/)
# a disqualified athlete will have integers for position and score
# values, so check match for 2 values
if (match = value.match(/\A\d/))
if (match)
puts match
puts 'in true'
athlete.qualified = true
# in the case that a score shows a user is disqualified,
# such as --(186), set the disqualified state in the db
else
puts 'in else'
athlete.qualified = false
end
end
end

athlete.save
end
end
Expand Down

0 comments on commit 04bc8fb

Please sign in to comment.