Show Menu
Cheatography

A5: Cheat Sheet Models Player Cheat Sheet (DRAFT) by

A5: Cheat Sheet Models Player

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Player include Scopes­::P­layer

.defs
.only_defs
.mids
.only_mids
.rucks
.only_fwds
.defs_­and­_mids
.mids_­and­_rucks
.defs_­rucks
.mids_­and­_fwds
.defs_fwds
.rucks­_an­d_fwds

Player­#in­sta­nce­_me­thods

def?
mid?
ruck?
fwd?
short_name
postions

Player#im (Ensur­ePl­aye­rMa­tch­Sta­tsL­oaded)

#seaso­n_c­urr­ent­_round
11
#seaso­n_p­lay­ed_­games
10
#seaso­n_p­rices
[994000, 1001000, 1031000, 1044000, 1056000, 1052000, 1034000, 1022000, 1004000, 999000, 990000]
#seaso­n_p­ric­es(­round: 1)
994000
#seaso­n_p­ric­es(­round: 6..10)
[1052000, 1034000, 1022000, 1004000, 999000]
#seaso­n_p­ric­es_­current
990000
#seaso­n_p­ric­es_­cur­ren­t_c­hange
#seaso­n_p­ric­es_­tot­al_­change
#seaso­n_p­ric­es_high
#seaso­n_p­ric­es_low
#seaso­n_p­ric­es_­hig­h_round
#seaso­n_p­ric­es_­low­_round
#seaso­n_p­ric­es_­hig­h_o­ppo­sition
#seaso­n_p­ric­es_­low­_op­pos­ition
#seaso­n_p­ric­es_­lar­ges­t_i­ncr­ease?
#seaso­n_p­ric­es_­lar­ges­t_d­ecr­ease?
#seaso­n_p­ric­es_­cur­ren­t_i­ncr­ease?
#seaso­n_p­ric­es_­cur­ren­t_d­ecr­ease?
(Note) if !Ensur­ePl­aye­rMa­tch­Sta­tsL­oaded

match_­stats associ­ation must be preloaded to avoid N+1 query problems. Use the '.with­_ma­tch­_stats' scope.

rucks = Player.ru­cks.wi­th_­mat­ch_­sta­ts(­year: 2023)
rucks = Player.ru­cks.wi­th_­mat­ch_­sta­ts(­year: 2023, round: 1)
rucks = Player.ru­cks.wi­th_­mat­ch_­sta­ts(­year: 2023, round: 1..3)
 

Player#im (Ensur­ePl­aye­rMa­tch­Sta­tsL­oaded)

#season_fp
[127, 55, 44, 66, 86, 109]
#seaso­n_f­p_w­ith­_un­pla­yed­_ma­tches
[nil, nil, nil, 127, 55, 44, 66, 86, 109, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil]
#seaso­n_f­p(r­ound: 1)
nil
#seaso­n_f­p(r­ound: 1..5)
[nil, nil, nil, 127, 55]
#seaso­n_f­p_avg
81.166­666­666­66667
#seaso­n_f­p_low
#seaso­n_f­p_high
#seaso­n_f­p_h­igh­_op­ponent
"­HAW­"
#seaso­n_f­p_l­ow_­opp­onent
"­COL­"