roo_on_rails 1.16.2 → 1.17.0

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: 1af8837a7d4c19932c3d43da96808038d249423f
4
- data.tar.gz: f900aacc150cb2476311ae68b76ad5fc85403304
3
+ metadata.gz: 65d37b2ac41421d649b77a7f66e521f949bbc83e
4
+ data.tar.gz: d2fe8895dfcb3ccdbd1d927f0da71d1b8993ebf9
5
5
  SHA512:
6
- metadata.gz: e86aff9a3a775ff85ad9f772fd97fbd22120e2849913e28038611f8396131cc90ac9edb81deb58d0df67c6671f4784194a737f8333acb75880db54b01b4eed45
7
- data.tar.gz: b0318f71146d438f300be2a3483f2cb620f23977622b573d9ab052d0df260e2b06c426a915657d989199ac452590b4109d9644da0369fee0c2a8c373553d4dce
6
+ metadata.gz: cd5326a3ce9cacd1298d209ff50a6e1dc14f44e95d1582d9e16e06bfec8c66871217cdeb8e8d3ba101e8ba8f6d7f8f582bdb1d960b5f4f1acdb78e4657a6eadd
7
+ data.tar.gz: 60381f042c1ead007a2dc0c768ca1f1a1eb5ab5c4b7f26e6f8bb884d94fcaab6065a03b507ece1ae1ac919886df5febfb5f969a9e7cec25b71dcc373bcd18e24
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  _Your awesome improvements here!_
4
4
 
5
+ # v1.17.0 (2018-01-09)
6
+
7
+ Features:
8
+
9
+ - Forced publishing of lifecycle events to Routemaster without model checks. (#86)
10
+
5
11
  # v1.16.2 (2017-12-15)
6
12
 
7
13
  Bug fix:
@@ -16,18 +16,26 @@ module RooOnRails
16
16
  private_constant :ACTIVE_RECORD_TO_ROUTEMASTER_EVENT_MAP
17
17
 
18
18
  def publish_lifecycle_event(event)
19
+ publish_event(event, force_publish: false)
20
+ end
21
+
22
+ def publish_lifecycle_event!(event)
23
+ publish_event(event, force_publish: true)
24
+ end
25
+
26
+ private
27
+
28
+ def publish_event(event, force_publish:)
19
29
  publishers = Routemaster::Publishers.for(self, routemaster_event_type(event))
20
30
  publishers.each do |publisher|
21
31
  begin
22
- publisher.publish!
32
+ publisher.publish!(force_publish: force_publish)
23
33
  rescue => e
24
34
  NewRelic::Agent.notice_error(e)
25
35
  end
26
36
  end
27
37
  end
28
38
 
29
- private
30
-
31
39
  def routemaster_event_type(event)
32
40
  ACTIVE_RECORD_TO_ROUTEMASTER_EVENT_MAP[event].tap do |type|
33
41
  raise "invalid lifecycle event '#{event}'" unless type
@@ -16,12 +16,12 @@ module RooOnRails
16
16
  noop? || @model.new_record? || @model.previous_changes.any?
17
17
  end
18
18
 
19
- def will_publish?
20
- Config.routemaster_publishing_enabled? && publish?
19
+ def will_publish?(force_publish: false)
20
+ Config.routemaster_publishing_enabled? && (force_publish || publish?)
21
21
  end
22
22
 
23
- def publish!
24
- return unless will_publish?
23
+ def publish!(force_publish: false)
24
+ return unless will_publish?(force_publish: force_publish)
25
25
  @client.send(
26
26
  @event,
27
27
  topic,
@@ -1,3 +1,3 @@
1
1
  module RooOnRails
2
- VERSION = '1.16.2'.freeze
2
+ VERSION = '1.17.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roo_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.2
4
+ version: 1.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Letessier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-15 00:00:00.000000000 Z
11
+ date: 2018-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv-rails