webflow_sync 0.2.4 → 1.1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e85c49b258ebbde8c6d5984893be9f59acf389505f0af30951d98fccc4b2f0d
|
4
|
+
data.tar.gz: '09b216274b17cfd61ff9aa1c2a2cc984b12655302daa4d25e3bb0e37a29b1180'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bea1e564a550a72cf7164e3cce4fb7710478e3683c8a1067b1dfc790b87679a59f4a03985fdf610628deeb4334d0d5bd540391afb85d4a41cbb85b67f323525
|
7
|
+
data.tar.gz: bc6bba426b31b48d20caa8ebbfa88e3ec3237b51faa8ac520e715c73fdedf18c1807eff59932e512200d47ed0fb7e921c0ca10b2cd5531cba5cc0096487f6323
|
data/README.md
CHANGED
@@ -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
|
@@ -8,6 +8,11 @@ module WebflowSync
|
|
8
8
|
@site_id = site_id
|
9
9
|
end
|
10
10
|
|
11
|
+
def get_item(collection_slug, webflow_item_id)
|
12
|
+
collection = find_webflow_collection(collection_slug)
|
13
|
+
client.item(collection['_id'], webflow_item_id)
|
14
|
+
end
|
15
|
+
|
11
16
|
def create_item(record, collection_slug) # rubocop:disable Metrics/MethodLength
|
12
17
|
collection = find_webflow_collection(collection_slug)
|
13
18
|
response = client.create_item(
|
@@ -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:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Viktor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-25 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.
|