About PtGolf.us

Group Players

Group Players contains names, optional contacts and quotas for players in the group.

class GroupPlayer < ActiveRecord::Base
 belongs_to :group
 has_one :user
 has_many :scored_rounds
 has_many :rounds, dependent: :destroy
end
Purpose
  • To store basic information on a Player (name, phone, primary tee)
  • To store quotas and date last played from last computed quota.
  • Quotas are computed when:
    • An Event is scored
    • An Event is deleted
    • A groups preferences are changed and the coordinator recomputes quotas
    • Rounds or Events are trimmed, removing old rounds and events.
    • The primary tee is changed.
Data Elements
group_id
player_id
The old_pin has be duplicated from old_pin. It will be renamed pin at some point
tee
Primary tee (color name from group tees). Quotas are computed by Tee. If a player moves up or down a Tee, their quota starts from the base quota which is the computed quota of the last (group rounds_used) rounds regardless of tee or group.
quota
The last computed quota (rounded or truncated) from the primary tee
last_played
The date that the player last played.
rquota
The last computed raw quota (decimal value before rounding or truncating). This quota is used in seeding players for teams,
first_name
last_name
full_name
Full name is set from first_name and last_name applying some formating rules.
nickname
If a player use usually referred to by a nickname, enter that name here and there name will be displayed (and sorted by) "nickname first_name last_name"
phone
Optional phone number of player. Only displayed if there is a user logged into the group.
old_pin
When players were imported from PTGOLFER.EXE, the record number was copied during the import process and used as a lookup since names were all screwed up. It is now duplicated as a pin number and must be unique within a Club.