webflow_sync 3.1.0 → 4.0.0
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 +4 -4
- data/app/jobs/webflow_sync/create_item_job.rb +1 -1
- data/app/jobs/webflow_sync/update_item_job.rb +1 -1
- data/app/models/concerns/webflow_sync/callbacks.rb +7 -4
- data/app/services/webflow_sync/api.rb +1 -1
- data/lib/generators/webflow_sync/collection_generator.rb +1 -1
- data/lib/webflow_sync/version.rb +1 -1
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59276bff6afd0f4fd22915ba780edb12d48a48f0dc7969470b66c3872d035993
|
4
|
+
data.tar.gz: 3bb7e9bc90c9e3f20f1a59c3735e2eefb4362b2c13f2aa798514991948ff270d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1ef6b8a1474439d7529f7f9a943b874362159b97b056ff125be97946084c37f561becadb9a6b148a9233d1fb20be10058bc6f354ac761623a4a329784065315
|
7
|
+
data.tar.gz: 4ed8884870586028d2278c8808771fe825e4e432a62d49157cb317e1eb2ddf93851fc28b01d2be3fbf0abd5d21dae2e68019589a37c7c9ba00e52895804845d5
|
@@ -12,7 +12,7 @@ module WebflowSync
|
|
12
12
|
# model_name = 'articles'; id = article.id, collection_slug = 'stories'
|
13
13
|
def perform(model_name, id, collection_slug = model_name.underscore.dasherize.pluralize)
|
14
14
|
model_class = model_name.underscore.classify.constantize
|
15
|
-
record = model_class.find_by(id:
|
15
|
+
record = model_class.find_by(id:)
|
16
16
|
return if record.blank?
|
17
17
|
return if record.webflow_site_id.blank?
|
18
18
|
|
@@ -8,7 +8,7 @@ module WebflowSync
|
|
8
8
|
# 'job_listing'.underscore.dasherize.pluralize => 'job-listings'
|
9
9
|
def perform(model_name, id, collection_slug = model_name.underscore.dasherize.pluralize)
|
10
10
|
model_class = model_name.underscore.classify.constantize
|
11
|
-
record = model_class.find_by(id:
|
11
|
+
record = model_class.find_by(id:)
|
12
12
|
return if record.blank?
|
13
13
|
return if record.webflow_site_id.blank?
|
14
14
|
return WebflowSync::CreateItemJob.perform_now(model_name, id, collection_slug) if record.webflow_item_id.blank?
|
@@ -13,21 +13,24 @@ module WebflowSync
|
|
13
13
|
after_commit :destroy_webflow_item, on: :destroy
|
14
14
|
|
15
15
|
def create_webflow_item
|
16
|
-
return if self.skip_webflow_sync ||
|
16
|
+
return if WebflowSync.configuration.skip_webflow_sync || self.skip_webflow_sync || self.webflow_site_id.blank?
|
17
17
|
|
18
18
|
WebflowSync::CreateItemJob.perform_later(self.model_name.collection, self.id)
|
19
19
|
end
|
20
20
|
|
21
21
|
def update_webflow_item
|
22
|
-
return if self.skip_webflow_sync ||
|
22
|
+
return if WebflowSync.configuration.skip_webflow_sync || self.skip_webflow_sync || self.webflow_site_id.blank?
|
23
23
|
|
24
24
|
WebflowSync::UpdateItemJob.perform_later(self.model_name.collection, self.id)
|
25
25
|
end
|
26
26
|
|
27
27
|
def destroy_webflow_item
|
28
|
-
return if self.skip_webflow_sync ||
|
28
|
+
return if WebflowSync.configuration.skip_webflow_sync || self.skip_webflow_sync || self.webflow_site_id.blank?
|
29
29
|
|
30
|
-
|
30
|
+
# Make sure slug is in the plural form, and multiple words slug separated by dashes
|
31
|
+
collection_slug = self.model_name.collection.underscore.dasherize
|
32
|
+
|
33
|
+
WebflowSync::DestroyItemJob.perform_later(collection_slug:,
|
31
34
|
webflow_site_id: self.webflow_site_id,
|
32
35
|
webflow_item_id: self.webflow_item_id)
|
33
36
|
end
|
@@ -82,7 +82,7 @@ module WebflowSync
|
|
82
82
|
def publish
|
83
83
|
return unless WebflowSync.configuration.publish_on_sync
|
84
84
|
|
85
|
-
response = make_request(:publish, site_id, domain_names:
|
85
|
+
response = make_request(:publish, site_id, domain_names:)
|
86
86
|
|
87
87
|
puts "Publish all domains for Webflow site with id: #{site_id}"
|
88
88
|
response
|
@@ -12,7 +12,7 @@ module WebflowSync
|
|
12
12
|
include Rails::Generators::Migration
|
13
13
|
def add_migration
|
14
14
|
migration_template 'migration.rb.erb', "#{migration_path}/add_webflow_item_id_to_#{table_name}.rb",
|
15
|
-
migration_version:
|
15
|
+
migration_version:
|
16
16
|
end
|
17
17
|
|
18
18
|
def include_item_sync_in_model_file
|
data/lib/webflow_sync/version.rb
CHANGED
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:
|
4
|
+
version: 4.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:
|
11
|
+
date: 2022-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: net-smtp
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: pry-rails
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -172,6 +186,7 @@ licenses:
|
|
172
186
|
metadata:
|
173
187
|
homepage_uri: https://github.com/vfonic/webflow_sync
|
174
188
|
source_code_uri: https://github.com/vfonic/webflow_sync
|
189
|
+
rubygems_mfa_required: 'true'
|
175
190
|
post_install_message:
|
176
191
|
rdoc_options: []
|
177
192
|
require_paths:
|
@@ -180,14 +195,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
180
195
|
requirements:
|
181
196
|
- - ">="
|
182
197
|
- !ruby/object:Gem::Version
|
183
|
-
version: '
|
198
|
+
version: '3.1'
|
184
199
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
200
|
requirements:
|
186
201
|
- - ">="
|
187
202
|
- !ruby/object:Gem::Version
|
188
203
|
version: '0'
|
189
204
|
requirements: []
|
190
|
-
rubygems_version: 3.
|
205
|
+
rubygems_version: 3.3.17
|
191
206
|
signing_key:
|
192
207
|
specification_version: 4
|
193
208
|
summary: Keep Rails models in sync with WebFlow.
|