Class: Dashboard
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Dashboard
- Defined in:
- app/models/dashboard.rb
Overview
This model holds the statistics for each user’s gaming history. It allows a user to track their progress and history for each game. Each user has a special “streak record” with game_id of -1 to track combined data for streak computations
Instance Attribute Summary collapse
-
#game_id ⇒ Integer
The game for which the record is.
-
#played_on ⇒ Date
The date on which the user played the game referenced in this entry.
-
#score ⇒ Integer
The score the user attained playing the game on the specific date.
-
#streak_count ⇒ Integer
The highest streak tracking consecutive days game played by user.
-
#user_id ⇒ Integer
The user for whom the record is.
Instance Attribute Details
#game_id ⇒ Integer
The game for which the record is. Foreign key referenced to the associated ‘Game` model. Id is -1 for streak record
13 14 15 |
# File 'app/models/dashboard.rb', line 13 def game_id @game_id end |
#played_on ⇒ Date
The date on which the user played the game referenced in this entry
13 14 15 |
# File 'app/models/dashboard.rb', line 13 def played_on @played_on end |
#score ⇒ Integer
The score the user attained playing the game on the specific date
13 14 15 |
# File 'app/models/dashboard.rb', line 13 def score @score end |
#streak_count ⇒ Integer
The highest streak tracking consecutive days game played by user. Only set when streak_record is true
13 14 15 |
# File 'app/models/dashboard.rb', line 13 def streak_count @streak_count end |
#user_id ⇒ Integer
The user for whom the record is. Foreign key referenced to the associated ‘User` model
13 14 15 |
# File 'app/models/dashboard.rb', line 13 def user_id @user_id end |