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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODZlNDA5M2U1ZDlkYWIzMGRmNGJiOWVlYWJmNmJiZmMyODAwZmU3Yw==
4
+ ODNkYTFjMTQzMTI1NjUyNzRmY2U2MzYyM2FlMjNhMzkxMWNiODU5NA==
5
5
  data.tar.gz: !binary |-
6
- YzdiM2QzM2NlYTc2YWViMzRiZmE0ZmY3MjVkMDA4YThlYTJlNDVhNg==
6
+ ZWUzNDkzYTNkYmM2NGYyNWQzMzE3OWI5MjIxZWU2MmQxMmY4MmUxOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTcxYzY3OTJiNjhmOTYwNjgwMjAzOGY3NThiYmIzNzA4MWNlMzlhOTIwYzYz
10
- ZTc0OWE1ZTQ0NGZmYjc3Yzg3MWEzZWQ0NTNhZGY0OTA2MWZjNWQ1YzE1ODgw
11
- NzFmNTVhMmJjMDMxNWI4YzUzMWExMGRhNTE5MzY4ZmIzZTVkOTM=
9
+ ZTZlMjhmOTk1NGI5MDVjZGVjNzE0ZjIxN2ZlM2UxMjIwYjZiNTg1NGQwY2Qx
10
+ MjAwNGEyODMyNDA4YzNlOGY2ZDkzMWNkZjZkOTYwMzQ3YjAyMWQyM2NkODZh
11
+ YTA5ZjYzYzJlMzU0ZjdhMDBiODllZDg0OTVlOGEzZmNhZDc0MmE=
12
12
  data.tar.gz: !binary |-
13
- MDY0MzIyNGNlNWEwNGI5ZmQ2NDA0OTJiODJlYWEwM2JjMWRkZDE3ZTNhY2U3
14
- Njk1ZGY5NmI3NjkwOGU5NDFjZDJjMzE1ODVjMDljNDRiNTY4MmMyZmQ2ZmI5
15
- MzEwNDM5YzU4ZDZkZDJmZDI2N2VkYTI5NzcwODIwZmQyYTRjMmY=
13
+ ZTcwMzMyZGU3NGIyYTZjNzFjYTY1Yzk5YTczYTZjNDFkY2Q4YzM3MjFkYmQw
14
+ ZGQ0Y2U1ZWIzODNjNzc3OTRhNTkxZmQ4ZTgwYmRlZWZjMzAxZjIwYjkyNzU4
15
+ Yzc4NzJmNTAxYTIwODMxNjAyYmUyZTcwOWU5MDVkNmI2MWE2ZmI=
@@ -34,13 +34,14 @@ module FlexibleFeeds
34
34
  end
35
35
 
36
36
  def calculate_stats
37
- self.votes_for = votes.where(value: 1).count
38
- self.votes_against = votes.where(value: -1).count
39
- self.votes_sum = votes_for - votes_against
40
- self.controversy = calculate_controversy(votes_for, votes_against)
41
- self.popularity = calculate_popularity(votes_for,
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
- save
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
@@ -1,3 +1,3 @@
1
1
  module FlexibleFeeds
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexible_feeds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - timothycommoner