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
  • 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
The old_pin has be duplicated from old_pin. It will be renamed pin at some point
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.
The last computed quota (rounded or truncated) from the primary tee
The date that the player last played.
The last computed raw quota (decimal value before rounding or truncating). This quota is used in seeding players for teams,
Full name is set from first_name and last_name applying some formating rules.
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"
Optional phone number of player. Only displayed if there is a user logged into the group.
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.