strongmind-platform-sdk 3.19.24 → 3.19.26

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4114cb50d41949abb29d2cddaa243fb53841fff22cd8c70cfb4981179bba0132
4
- data.tar.gz: '009d6c15649e26789c70d50aef1baab58af837a7e1f02e838009227a517b1359'
3
+ metadata.gz: 5f0b9016b0347f66b314011c0a0a77106df02a77372071bb3239ff650a6106dc
4
+ data.tar.gz: 5a5a2e0177334428ba4a6e8544baef6747f95afa13264ec880aaf535a330be39
5
5
  SHA512:
6
- metadata.gz: ddc3285e6bee1ca774d875932e989bd62eac287788d182d45bae8d156d2f87d51592415f5e736bb57ebe40d82c1c974c0608816ae3dc0b6a94f42cbb02005caf
7
- data.tar.gz: aedda545a1e97d1c8563650d14707d9ad133e1d4e1a95a59941d0cad1a5cb3d367994d1cfc7c8c4e8972fe04d8677df89d124e564b7487c54d0afdd79f4a87dc
6
+ metadata.gz: '0619f6882d3bc31ab58aa50abd0561eb3a851598bf40e59bb756c23c98904ad42438acfbe11b37e7daacb025b3a7fb4c1444cc3ca45c5d0d5258a7b33f71e6fc'
7
+ data.tar.gz: 621f93fe77651a43958a69dd3de6b9c3ad01c91a82780f19fcd9e8f91474023a42fc1934ffd6749d59690ee136d1cb8aaa0bff48f2e89f7db6d4816c8109ba91
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strongmind-platform-sdk (3.19.24)
4
+ strongmind-platform-sdk (3.19.26)
5
5
  activesupport (~> 7.1)
6
6
  asset_sync
7
7
  aws-sdk-secretsmanager (~> 1.66)
@@ -103,11 +103,11 @@ GEM
103
103
  unf
104
104
  ast (2.4.2)
105
105
  aws-eventstream (1.3.0)
106
- aws-partitions (1.951.0)
106
+ aws-partitions (1.954.0)
107
107
  aws-sdk-cloudwatch (1.96.0)
108
108
  aws-sdk-core (~> 3, >= 3.201.0)
109
109
  aws-sigv4 (~> 1.5)
110
- aws-sdk-core (3.201.0)
110
+ aws-sdk-core (3.201.1)
111
111
  aws-eventstream (~> 1, >= 1.3.0)
112
112
  aws-partitions (~> 1, >= 1.651.0)
113
113
  aws-sigv4 (~> 1.8)
@@ -133,7 +133,7 @@ GEM
133
133
  erubi (1.12.0)
134
134
  ethon (0.16.0)
135
135
  ffi (>= 1.15.0)
136
- excon (0.110.0)
136
+ excon (0.111.0)
137
137
  factory_bot (6.4.6)
138
138
  activesupport (>= 5.0.0)
139
139
  faker (3.3.1)
@@ -145,7 +145,7 @@ GEM
145
145
  faraday-retry (2.2.1)
146
146
  faraday (~> 2.0)
147
147
  ffi (1.16.3)
148
- fog-aws (3.23.0)
148
+ fog-aws (3.24.0)
149
149
  fog-core (~> 2.1)
150
150
  fog-json (~> 1.1)
151
151
  fog-xml (~> 0.1)
@@ -7,9 +7,21 @@ module PlatformSdk
7
7
  extend ActiveSupport::Concern
8
8
 
9
9
  included do
10
- after_create -> { send_to_pipeline('created') }
11
- before_destroy -> { send_to_pipeline('destroyed') }
12
- after_update -> { send_to_pipeline('modified') }
10
+ after_create :send_pipeline_create
11
+ before_destroy :send_pipeline_destroy
12
+ after_update :send_pipeline_update
13
+ end
14
+
15
+ def send_pipeline_create
16
+ send_to_pipeline('created')
17
+ end
18
+
19
+ def send_pipeline_update
20
+ send_to_pipeline('modified')
21
+ end
22
+
23
+ def send_pipeline_destroy
24
+ send_to_pipeline('destroyed')
13
25
  end
14
26
 
15
27
  def pipeline_payload(action)
@@ -20,7 +20,7 @@ module PlatformSdk
20
20
  end
21
21
 
22
22
  let(:record) { build(described_class.to_s.underscore.to_sym) }
23
- let(:data_pipeline_client) { double(PlatformSdk::DataPipeline::Client)}
23
+ let(:data_pipeline_client) { double(PlatformSdk::DataPipeline::Client) }
24
24
 
25
25
  before do
26
26
  allow(PlatformSdk::DataPipeline::Client).to receive(:new).and_return(data_pipeline_client)
@@ -54,11 +54,17 @@ module PlatformSdk
54
54
  context 'after_update callbacks' do
55
55
  let(:action) { 'modified' }
56
56
 
57
- it "defines an after_update callback" do
57
+ before do
58
+ allow(record).to receive(:send_pipeline_create)
58
59
  record.save!
60
+ end
61
+
62
+ it "defines an after_update callback" do
59
63
  column = column_to_update(record)
60
- update_record(record, column)
61
- expect(data_pipeline_client).to have_received(:post).with(pipeline_payload)
64
+ unless column.nil?
65
+ update_record(record, column)
66
+ expect(data_pipeline_client).to have_received(:post).with(pipeline_payload)
67
+ end
62
68
  end
63
69
  end
64
70
 
@@ -67,6 +73,7 @@ module PlatformSdk
67
73
  columns_to_update = record.class.columns.select { |c| c.sql_type_metadata.type == type && !c.name.match?(/(_id|_type)$/) && c.name != 'id' }
68
74
  return columns_to_update.first.name if columns_to_update.any?
69
75
  end
76
+ nil
70
77
  end
71
78
 
72
79
  def update_record(record, column)
@@ -78,8 +78,12 @@ module PlatformSdk
78
78
  context "after_update callbacks" do
79
79
  let(:action) { "modified" }
80
80
 
81
- it "defines an after_update callback" do
81
+ before do
82
+ allow(record).to receive(:send_pipeline_create)
82
83
  record.save!
84
+ end
85
+
86
+ it "defines an after_update callback" do
83
87
  column = column_to_update(record)
84
88
  update_record(record, column)
85
89
  expect(data_pipeline_client).to have_received(:post).with(pipeline_payload)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlatformSdk
4
- VERSION = '3.19.24'
4
+ VERSION = '3.19.26'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strongmind-platform-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.19.24
4
+ version: 3.19.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platform Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-03 00:00:00.000000000 Z
11
+ date: 2024-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday