Daniel Schädler
79bafec693
Add advancing teams into tournaments show endpoint
2025-03-09 21:05:41 +01:00
Daniel Schädler
5d857c5d82
Remove position from comparison
2024-04-07 21:40:59 +02:00
Daniel Schädler
4a8cb71fc4
Add and calculate position to sort group_scores by
2024-04-07 21:17:45 +02:00
Daniel Schädler
1084d836c1
Implement sorting correctly with <=> operator
2024-04-07 18:07:55 +02:00
Daniel Schädler
c3af6f9232
Rubocop -A
2021-08-15 14:31:50 +02:00
Daniel Schädler
33ccab8988
Return all matches also from groups
2019-10-26 00:32:14 +02:00
Daniel Schädler
77c76b7a31
Add matches method to tournament
...
The method collects all matches from all stages
2019-10-25 23:47:38 +02:00
Daniel Schädler
4e72d015ff
Implement method to check if stage is over
2019-06-18 19:22:05 +02:00
Daniel Schädler
c5780c2da3
Implement function to calculate the difference in points
2019-06-18 19:22:05 +02:00
Thor77
6640be1e9a
Add devise confirmable to user model
2019-06-18 12:27:00 +02:00
Daniel Schädler
98319e9625
Assign :intermediate_stage to first stage if single_team matches present
2019-06-17 15:02:30 +02:00
Daniel Schädler
36db03293e
Return a "winner" for :single_team matches
2019-06-17 15:02:30 +02:00
Thor77
f3431e8442
Add bet model
...
* has_many relations in all belonging models
* specs for relations in existing models
* association specs for bet model
2019-06-17 13:48:49 +02:00
Daniel Schädler
2e336262aa
Add state to stage
...
This state is required to stop the group stage and trigger playoff
generation, it is (for now) irrelevant for anything other than that.
2019-06-13 13:21:24 +02:00
Daniel Schädler
4d5d7bc812
Only allow positive powers of two for playoff_teams_amount
2019-06-13 13:21:24 +02:00
Daniel Schädler
564cec2820
Add method to check if match_score is part of a group match
2019-06-05 09:49:21 +02:00
Daniel Schädler
752beefca6
Correctly handle matches that are not started yet
2019-06-05 09:49:21 +02:00
Daniel Schädler
c1dc43948b
Fix typo in received_points
2019-06-05 09:49:21 +02:00
Daniel Schädler
bd0f8c7fd2
Replace guard clauses with ternary operator
...
@thor77 apparently thinks this is better then it was before.. i don't
really care so here we go ¯\_(ツ)_/¯
2019-06-05 09:49:20 +02:00
Daniel Schädler
e868e936e4
Implement Methods returning points of teams per match
...
These methods return group_points scored_points and received_points
respectively when given a team that is present in the match
They return 0 when given a team that isn't contesting in that match
2019-06-05 09:26:11 +02:00
Daniel Schädler
2f77d2d25b
Add winner method to match
2019-05-26 20:14:13 +02:00
Daniel Schädler
280b0c1dec
Change status of Match to only represent being finished
...
The winner will be a attribute of the Match instead of something
that is written in its status.
2019-05-26 20:14:13 +02:00
Daniel Schädler
1a2caaedef
Remove unused evaluate status method
2019-05-26 20:14:13 +02:00
Daniel Schädler
b36e3c4251
Delegate owner of team to tournament again
2019-05-22 09:25:07 +02:00
Daniel Schädler
03d7369a1c
Remove link between team.owner and tournament
2019-05-22 09:25:07 +02:00
Thor77
894608c19e
Fix Stage.teams returning nil on error
2019-05-16 20:53:03 +02:00
Thor77
1b9db61c22
Add owner method to Stage, Group and Match
2019-05-07 18:41:52 +02:00
Daniel Schädler
6a2c71bad7
Fix stage.team method not returning teams for playoff stages
2019-05-04 20:34:57 +02:00
Daniel Schädler
26b8ff96c9
Add teams method to group,match,stage
...
It returns the unique teams that compete within the object
2019-05-04 20:34:57 +02:00
Thor77
22e547befa
Add validatable attribute to User model
...
to get email and password (existence) validation
2019-04-23 10:47:50 +02:00
Thor77
d7910c093b
Update user model to extend devise models
2019-04-03 09:43:04 +02:00
Thor77
2f828542ef
Alias recieved_points to received_points
...
to avoid a change of the db schema for now
2018-12-11 17:12:55 +01:00
Thor77
dc17cad154
Ensure uniqueness of generated Tournament.code
2018-12-02 13:51:54 +01:00
Thor77
7f59d6fb0e
Delegate Score.owner to parent team
2018-11-30 14:38:56 +01:00
Daniel Schädler
68f9b3b2b3
Change Score to MatchScore & MatchScore score attribute to points
...
This is done to improve the naming and therefore make things easier to understand.
2018-11-30 14:15:48 +01:00
Daniel Schädler
1c318cde1a
Add State to Model
2018-11-29 10:47:17 +01:00
Thor77
9d4d39c135
Make Team.belongs_to :tournament optional
...
necessary for testing TeamController building relationship on create
2018-11-25 22:55:49 +01:00
Thor77
8b3b8352e5
Delegate owner attribute to tournament
2018-11-24 19:16:04 +01:00
Thor77
673e12c052
Validate Stage xor Group present in match
2018-11-20 16:03:58 +01:00
Thor77
552566dd2e
Validate match has only 2 scores
2018-11-19 14:57:55 +01:00
Thor77
0bcd3a88a9
Validate presence of name
2018-11-19 14:45:01 +01:00
Thor77
65abada8b2
Modify model associations to map to new schema
2018-11-19 11:47:14 +01:00
Thor77
03f362a7fe
Add Score and Stage model
2018-11-19 11:47:14 +01:00
Thor77
21103588a2
Remove unused Group- and PlayoffStage models
...
because they are now both represented by the Stage model
2018-11-19 11:47:13 +01:00
Thor77
556f326acd
Alias Tournament.user to Tournament.owner
2018-11-19 11:47:12 +01:00
Thor77
b742b3ed67
Move group scores into separate table
2018-11-19 11:47:12 +01:00
Thor77
07eb561f77
Implement Tournament-Team relation
2018-11-19 11:47:12 +01:00
Thor77
20fafab009
Generate tournament code if not given
2018-11-19 11:47:11 +01:00
Thor77
d89c24a645
Add relation between Tournament and User
2018-11-19 11:47:11 +01:00
Thor77
c9421e6d42
Add Tournament model
2018-11-11 21:31:47 +01:00