Skip to content

Commit e116506

Browse files
authored
Make Gold status less scrict (#388)
* remap gold and silver status * Update score.ex * Update score.ex again
1 parent fe97cf4 commit e116506

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/plexus/ratings.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,28 +88,28 @@ defmodule Plexus.Ratings do
8888

8989
def gold_de_googled_count do
9090
Rating
91-
|> where([rating], rating.score >= 4)
91+
|> where([rating], rating.score >= 3.5)
9292
|> where([rating], rating.rating_type == :native)
9393
|> Repo.aggregate(:count)
9494
end
9595

9696
def gold_micro_g_count do
9797
Rating
98-
|> where([rating], rating.score >= 4)
98+
|> where([rating], rating.score >= 3.5)
9999
|> where([rating], rating.rating_type == :micro_g)
100100
|> Repo.aggregate(:count)
101101
end
102102

103103
def silver_de_googled_count do
104104
Rating
105-
|> where([rating], rating.score >= 3 and rating.score < 4)
105+
|> where([rating], rating.score >= 3 and rating.score < 3.5)
106106
|> where([rating], rating.rating_type == :native)
107107
|> Repo.aggregate(:count)
108108
end
109109

110110
def silver_micro_g_count do
111111
Rating
112-
|> where([rating], rating.score >= 3 and rating.score < 4)
112+
|> where([rating], rating.score >= 3 and rating.score < 3.5)
113113
|> where([rating], rating.rating_type == :micro_g)
114114
|> Repo.aggregate(:count)
115115
end

lib/plexus/schemas/score.ex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ defmodule Plexus.Schemas.Score do
1111
end
1212

1313
def level(%Score{numerator: numerator}) do
14-
case floor(numerator) do
15-
0 -> :unrated
16-
1 -> :borked
17-
2 -> :bronze
18-
3 -> :silver
19-
4 -> :gold
14+
cond do
15+
numerator < 1 -> :unrated
16+
numerator < 2 -> :borked
17+
numerator < 3 -> :bronze
18+
numerator < 3.5 -> :silver
19+
true -> :gold
2020
end
2121
end
2222
end

0 commit comments

Comments
 (0)