activist 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activist (0.0.7)
4
+ activist (0.0.8)
5
5
  activesupport (~> 3.0)
6
6
  redis (~> 2.2)
7
7
  redis-namespace (= 0.10.0)
@@ -72,18 +72,20 @@ module Activist
72
72
  nil
73
73
  end
74
74
 
75
- status = ::ActivistStatus.create! do |s|
76
- s.actor_class = actor.class.to_s
77
- s.actor_id = actor.id
78
- s.action = action
79
- s.target_class = self.class.to_s
80
- s.target_id = self.id
81
- s.data = data
82
- s.created_at = Time.now.utc
83
- end
84
-
85
- actor.send("#{stream}_stream").subscribers.each do |subscriber|
86
- Redis.execute.lpush("#{subscriber.class}.#{subscriber.id}:#{stream}", status.id)
75
+ subscribers = actor.send("#{stream}_stream").subscribers
76
+ if subscribers.any?
77
+ status = ::ActivistStatus.create! do |s|
78
+ s.actor_class = actor.class.to_s
79
+ s.actor_id = actor.id
80
+ s.action = action
81
+ s.target_class = self.class.to_s
82
+ s.target_id = self.id
83
+ s.data = data
84
+ s.created_at = Time.now.utc
85
+ end
86
+ subscribers.each do |subscriber|
87
+ Redis.execute.lpush("#{subscriber.class}.#{subscriber.id}:#{stream}", status.id)
88
+ end
87
89
  end
88
90
  end
89
91
  end
@@ -1,3 +1,3 @@
1
1
  module Activist
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: activist
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.7
5
+ version: 0.0.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - "Adrian Duli\xC4\x87"