webflow_sync 0.2.2 → 0.3.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 651ec5a8ddb34444092eeb0f05807287eefa5427c346caecc7256d67071d80ac
|
4
|
+
data.tar.gz: faa3ba27c9e1d6244dcf99ebfab0229354612e11f103e18af5311155738c1bf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3eed7f9c4cfc3f8d095b3bacdf5d53b36bac4df2e6814d59ccfed42a2ad96c5825d3c448c4e15929018d4e01e8441e1b7ca031680241bf626f777b41aea3e538
|
7
|
+
data.tar.gz: f6805e73191bae71db5b4732de53a946bc4858b78a3ffbd62d90a8145c816645fc7193e4006e77ea6f029c2a716f7b3d7e2af270704367c6d08b9e40d12d20bf
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ module WebflowSync
|
|
7
7
|
record = model_class.find_by(id: id)
|
8
8
|
return if record.blank?
|
9
9
|
return if record.webflow_site_id.blank?
|
10
|
-
return if record.webflow_item_id.blank?
|
10
|
+
return WebflowSync::CreateItemJob.perform_now(collection_slug, id) if record.webflow_item_id.blank?
|
11
11
|
|
12
12
|
WebflowSync::Api.new(record.webflow_site_id).update_item(record, collection_slug)
|
13
13
|
end
|
@@ -8,9 +8,9 @@ module WebflowSync
|
|
8
8
|
included do
|
9
9
|
attr_accessor :skip_webflow_sync
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
after_commit :create_webflow_item, on: :create
|
12
|
+
after_commit :update_webflow_item, on: :update
|
13
|
+
after_commit :destroy_webflow_item, on: :destroy
|
14
14
|
|
15
15
|
def create_webflow_item
|
16
16
|
return if self.skip_webflow_sync || WebflowSync.configuration.skip_webflow_sync
|
@@ -9,7 +9,7 @@ module WebflowSync
|
|
9
9
|
yield(self.configuration)
|
10
10
|
|
11
11
|
self.configuration.api_token ||= ENV.fetch('WEBFLOW_API_TOKEN')
|
12
|
-
self.configuration.skip_webflow_sync
|
12
|
+
defined?(self.configuration.skip_webflow_sync) or self.configuration.skip_webflow_sync = !Rails.env.production?
|
13
13
|
end
|
14
14
|
|
15
15
|
private
|
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: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Viktor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02
|
11
|
+
date: 2021-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
|
-
rubygems_version: 3.2.
|
176
|
+
rubygems_version: 3.2.11
|
177
177
|
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: Keep Rails models in sync with WebFlow.
|