Permalink
Browse files

clean up qualification, but it is still not working as expected

  • Loading branch information...
1 parent 42f05f5 commit 04bc8fbf3f3686fcc56dae2f8bd4e49f7407af8b @mikepmunroe committed Mar 27, 2013
Showing with 2 additions and 11 deletions.
  1. +1 −1 app/controllers/wicked_controller.rb
  2. +1 −10 app/models/athlete.rb
@@ -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')
View
@@ -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

0 comments on commit 04bc8fb

Please sign in to comment.