flexible_feeds 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/models/flexible_feeds/event.rb +7 -6
- data/lib/flexible_feeds/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODNkYTFjMTQzMTI1NjUyNzRmY2U2MzYyM2FlMjNhMzkxMWNiODU5NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWUzNDkzYTNkYmM2NGYyNWQzMzE3OWI5MjIxZWU2MmQxMmY4MmUxOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTZlMjhmOTk1NGI5MDVjZGVjNzE0ZjIxN2ZlM2UxMjIwYjZiNTg1NGQwY2Qx
|
10
|
+
MjAwNGEyODMyNDA4YzNlOGY2ZDkzMWNkZjZkOTYwMzQ3YjAyMWQyM2NkODZh
|
11
|
+
YTA5ZjYzYzJlMzU0ZjdhMDBiODllZDg0OTVlOGEzZmNhZDc0MmE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTcwMzMyZGU3NGIyYTZjNzFjYTY1Yzk5YTczYTZjNDFkY2Q4YzM3MjFkYmQw
|
14
|
+
ZGQ0Y2U1ZWIzODNjNzc3OTRhNTkxZmQ4ZTgwYmRlZWZjMzAxZjIwYjkyNzU4
|
15
|
+
Yzc4NzJmNTAxYTIwODMxNjAyYmUyZTcwOWU5MDVkNmI2MWE2ZmI=
|
@@ -34,13 +34,14 @@ module FlexibleFeeds
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def calculate_stats
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
votes_for = votes.where(value: 1).count
|
38
|
+
votes_against = votes.where(value: -1).count
|
39
|
+
votes_sum = votes_for - votes_against
|
40
|
+
controversy = calculate_controversy(votes_for, votes_against)
|
41
|
+
popularity = calculate_popularity(votes_for,
|
42
42
|
votes_for + votes_against)
|
43
|
-
|
43
|
+
update_columns(votes_for: votes_for, votes_against: votes_against,
|
44
|
+
votes_sum: votes_sum, controversy: controversy, popularity: popularity)
|
44
45
|
end
|
45
46
|
|
46
47
|
def increment_parent_counter
|