state-notifier 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73ce4a60f6702e34304282f7ce98882e463cc38a
4
- data.tar.gz: 912eb8dc3bd4441a8839c0e8e54336ce4583b5ef
3
+ metadata.gz: 59baab57700f2509be2c7d44cd716e72ed2df7c0
4
+ data.tar.gz: 6844fd80a76db36bef39de544cb4992646d7b17a
5
5
  SHA512:
6
- metadata.gz: 77745fabbc8c4e56256a8917b6d124f13e783270dc2beeb585be46dd767bc0a5e47f7ee7d95e17f8fdf2850c3625cc5d05d056598141fa54896b70ef51c72966
7
- data.tar.gz: 99dd5ef77b6a4909ab4c7e92b13ade67c8ebd21333544fc3b61feedb258c08d865e41d8c1c19a0f36a66992d29da0936d3a16a69837866192a4709957fff53e9
6
+ metadata.gz: abe3e3c892066173290754f88dc79e0e8ea61debd0bacf73fa013465b7da7b5dd79cd8e4bc908cd775fba02891fa7417bef1910bf4b4f1adfce319bbe1e687fb
7
+ data.tar.gz: 9b707ecd570f148c87530e41d186fe1415ef1535d878d511d94adc3aac2823142be475daad749232cb70702512290192473ff662cd6720c8b53ff4b59fbcf808
@@ -5,10 +5,23 @@ module State
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  def notify_targets(event)
8
- name = self.class.name.underscore
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 = self.class.notification_targets.map do |m|
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"
@@ -1,5 +1,5 @@
1
1
  module State
2
2
  module Notifier
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
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.8
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: 2014-04-28 00:00:00.000000000 Z
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.2.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.