discourse_subscription_client 0.1.6 → 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: 41471a1d6a925dea2dbda3200eb6c0d969c7596fe198add3777e9a667e46ec8c
4
- data.tar.gz: e67947bded1babfd33b7f93f74f69aaf7b6202ed7bfef5ca6659a9a2d48c090e
3
+ metadata.gz: f18845628b38637a55730279c38b6eb79a781ee92397249f87f59535273c1223
4
+ data.tar.gz: 0d5ee97121224e465853bca566e636feab9e9f11bbfb7f0c55ddcf7133639919
5
5
  SHA512:
6
- metadata.gz: 4f381d6e4adc9ab55a79279b18e1b9d0d908c993d90795fc192c0fc39731225ab29c854560a96592215c0c0fd0d6d3c791e49b10c8d0a690022f0faf22d098ee
7
- data.tar.gz: 27b641921053f1455df6497cd5b770487d11ea53605760816e4e13d51d45f1b992f01463af5a981933e55ae2e124a49dc8b4c6b82d1df14f8a843b0e2976a258
6
+ metadata.gz: 4925d0d4fa305be65af680a5b4e6d59ff4edcd1625308642f2ee76bf5a0e9fbeffb90781ff9d4742e47730bfadde65137cc4584c0136575d2b4ccde34860bbb4
7
+ data.tar.gz: 1b9219ddd8859ed418547d1f723b357cdcef1a552be53b3db9e9b7c0b57d1f7990bf9c9efc1940c0c8de0fe1423e066ec09bacb75af9611c616ef2d8b7423d7d
@@ -4,6 +4,7 @@ module DiscourseSubscriptionClient
4
4
  class SupplierSerializer < ApplicationSerializer
5
5
  attributes :id,
6
6
  :name,
7
+ :url,
7
8
  :authorized,
8
9
  :authorized_at
9
10
 
@@ -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.6"
4
+ VERSION = "0.1.8"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discourse_subscription_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angus McLeod
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-16 00:00:00.000000000 Z
11
+ date: 2024-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers