discourse_subscription_client 0.1.7 → 0.1.8

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
  SHA256:
3
- metadata.gz: 03fe5f25d9d530751ddc8530ff74fb3bca6eef434172769f621beb0ddaebf8bb
4
- data.tar.gz: 39a728c0ffecdbbfb5d4b6b69983b49fa533dd410ccecd72dfb52aa19657d3ed
3
+ metadata.gz: f18845628b38637a55730279c38b6eb79a781ee92397249f87f59535273c1223
4
+ data.tar.gz: 0d5ee97121224e465853bca566e636feab9e9f11bbfb7f0c55ddcf7133639919
5
5
  SHA512:
6
- metadata.gz: ce4bf56aecb3056ecdda3888508088511417f5739334203dc16d0504324bb4acdb8314de6fdc9818cf14942367e26594c4c91d911eec060cc0d2deb2dac0d72b
7
- data.tar.gz: c26396551c3dea1b80770918dbc64d4b7ff423e6b0e674ce856c87a46114b11a8ac074cad7631ac47e4cc61350749a34470e925757fea992dba22cfc9623e300
6
+ metadata.gz: 4925d0d4fa305be65af680a5b4e6d59ff4edcd1625308642f2ee76bf5a0e9fbeffb90781ff9d4742e47730bfadde65137cc4584c0136575d2b4ccde34860bbb4
7
+ data.tar.gz: 1b9219ddd8859ed418547d1f723b357cdcef1a552be53b3db9e9b7c0b57d1f7990bf9c9efc1940c0c8de0fe1423e066ec09bacb75af9611c616ef2d8b7423d7d
@@ -54,24 +54,20 @@ module DiscourseSubscriptionClient
54
54
  return (supplier.deactivate_all_subscriptions! && @result.connection_error(supplier)) if response.nil?
55
55
 
56
56
  subscription_data = @result.retrieve_subscriptions(supplier, response)
57
- return supplier.deactivate_all_subscriptions! if @result.errors.any?
57
+ return supplier.deactivate_all_subscriptions! if subscription_data.blank?
58
58
 
59
59
  # deactivate any of the supplier's subscriptions not retrieved from supplier
60
- if supplier.subscriptions.present?
61
- supplier.subscriptions.each do |subscription|
62
- has_match = false
63
- subscription_data.each do |data|
64
- if data_matches_subscription(data, subscription)
65
- data.subscription = subscription
66
- has_match = true
67
- end
60
+ supplier.subscriptions.each do |subscription|
61
+ has_match = false
62
+ subscription_data.each do |data|
63
+ if data_matches_subscription(data, subscription)
64
+ data.subscription = subscription
65
+ has_match = true
68
66
  end
69
- subscription.deactivate! unless has_match
70
67
  end
68
+ subscription.deactivate! unless has_match
71
69
  end
72
70
 
73
- return @result.no_subscriptions(supplier) if subscription_data.blank?
74
-
75
71
  subscription_data.each do |data|
76
72
  if data.subscription.present?
77
73
  data.subscription.update(subscribed: true)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DiscourseSubscriptionClient
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discourse_subscription_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angus McLeod