state-notifier 0.0.8 → 0.0.9
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.
- checksums.yaml +4 -4
- data/lib/state/notifier.rb +15 -2
- data/lib/state/notifier/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59baab57700f2509be2c7d44cd716e72ed2df7c0
|
4
|
+
data.tar.gz: 6844fd80a76db36bef39de544cb4992646d7b17a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abe3e3c892066173290754f88dc79e0e8ea61debd0bacf73fa013465b7da7b5dd79cd8e4bc908cd775fba02891fa7417bef1910bf4b4f1adfce319bbe1e687fb
|
7
|
+
data.tar.gz: 9b707ecd570f148c87530e41d186fe1415ef1535d878d511d94adc3aac2823142be475daad749232cb70702512290192473ff662cd6720c8b53ff4b59fbcf808
|
data/lib/state/notifier.rb
CHANGED
@@ -5,10 +5,23 @@ module State
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
def notify_targets(event)
|
8
|
-
|
8
|
+
|
9
|
+
klass = self.class
|
10
|
+
|
11
|
+
# support subclassing. search through parent chain for notification settings
|
12
|
+
while klass && ! klass.notification_targets
|
13
|
+
klass = klass.superclass
|
14
|
+
end
|
15
|
+
|
16
|
+
unless klass
|
17
|
+
Rails.logger.debug "couldn't find notifier settings for #{self.class.name}"
|
18
|
+
return
|
19
|
+
end
|
20
|
+
|
21
|
+
name = klass.name.underscore
|
9
22
|
method = [name, event] * '_'
|
10
23
|
|
11
|
-
targets =
|
24
|
+
targets = klass.notification_targets.map do |m|
|
12
25
|
m.is_a?(Symbol) ? send(m) : m
|
13
26
|
end.flatten
|
14
27
|
Rails.logger.debug "StateNotifier: notifying #{method}, #{targets.size} targets"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: state-notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vitaly Kushner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
version: '0'
|
88
88
|
requirements: []
|
89
89
|
rubyforge_project:
|
90
|
-
rubygems_version: 2.
|
90
|
+
rubygems_version: 2.4.8
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: Simple gem to notify 'subscribers' about record state changes.
|