webflow_sync 8.0.0 → 9.0.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
  SHA256:
3
- metadata.gz: 133f038b4f15d4557856a3c5e7fa95062105fc2681d37f900155e8f1788b24dd
4
- data.tar.gz: da9361bcabb54bdcaea7842e9809e40751cf5a69acb79069c74a5cd6617d572c
3
+ metadata.gz: b8fd929a83a27160a05394b80cb0b00fdd70951d8a8be0e4c9dd59f584a9eb19
4
+ data.tar.gz: 61abc4b09b23fab7fbcbd31b560dde4cd0aaab365fac9e9d056cb524f4918a9f
5
5
  SHA512:
6
- metadata.gz: 2510e4fb4ba776b3c287029b7df253cdbfcf4110f327417e29a7b58ab19f9c6fa8ddf8ab259936e10a69fd4ad054ab54b98d7c2f5829a68d7b03756a5170a03e
7
- data.tar.gz: 1136fd8be0375a1817563acbe9b311633f807ab94c374cd5c6921bb2fdf7847c7b94873e9ac2fe41de269fe09f921cae8b8e1d5a7bc80a995f3d5140ed72f682
6
+ metadata.gz: f6f2d26fcd46a36806fe574f44151f5cb4ef1b0bd69008814386f7b4955a995564f48142f192761817bed452752ee27b608760c69121bd5fafad74d7cdd27c2b
7
+ data.tar.gz: 18b0167348eafdb20e96d14db7c10371b18f43f9d4905f7ab0e59cd6483fed02e9049c63093ca9a350640b31833833c817a0d21e76d24cfd3d3ea918e7dcf994
@@ -5,10 +5,9 @@ module WebflowSync
5
5
  def perform(collection_slug)
6
6
  model_class = collection_slug.underscore.classify.constantize
7
7
  model_class.where(webflow_item_id: nil).find_each do |record|
8
- next if record.webflow_site_id.blank?
8
+ next if record.should_skip_webflow_sync?
9
9
 
10
- collection_id = client(record.webflow_site_id).find_collection_id(collection_slug:)
11
- client(record.webflow_site_id).create_item(collection_id:, record:)
10
+ client(record.webflow_site_id).create_item(collection_id: record.webflow_collection_id, record:)
12
11
  end
13
12
  end
14
13
 
@@ -30,12 +30,10 @@ module WebflowSync
30
30
  WebflowSync::DestroyItemJob.perform_later(collection_id: self.webflow_collection_id, webflow_site_id:, webflow_item_id:)
31
31
  end
32
32
 
33
- private
34
-
35
- def should_skip_webflow_sync?
36
- WebflowSync.configuration.skip_webflow_sync || self.skip_webflow_sync ||
37
- self.webflow_site_id.blank? || self.webflow_collection_id.blank?
38
- end
33
+ def should_skip_webflow_sync?
34
+ WebflowSync.configuration.skip_webflow_sync || self.skip_webflow_sync ||
35
+ self.webflow_site_id.blank? || self.webflow_collection_id.blank?
36
+ end
39
37
  end
40
38
  end
41
39
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WebflowSync
4
- VERSION = '8.0.0'
4
+ VERSION = '9.0.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webflow_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.0
4
+ version: 9.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Viktor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-12 00:00:00.000000000 Z
11
+ date: 2024-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
- rubygems_version: 3.4.22
90
+ rubygems_version: 3.5.9
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: Keep Rails models in sync with WebFlow.