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: 51d3fbd1fefa9f412b3287531e8dec6d52d03546afe4063434702cb021353162
4
- data.tar.gz: 22d4da618915e33a1e056c452262b1d9dc6568f7563afa3ee0e109f6fb3ba683
3
+ metadata.gz: 5e85c49b258ebbde8c6d5984893be9f59acf389505f0af30951d98fccc4b2f0d
4
+ data.tar.gz: '09b216274b17cfd61ff9aa1c2a2cc984b12655302daa4d25e3bb0e37a29b1180'
5
5
  SHA512:
6
- metadata.gz: 0670d11d908b9f7b5a310834c427dfb66943e5b7107b77bebcc7d4a62672d037abe55af72336927ef98c0b0bdee8ea5e6bb4b5764dbe7b5848936c9e6ace0922
7
- data.tar.gz: 4a018e0fbc27ec6f6552a957939f917782cd55bf9693ce9c18de436c21c1ffa3d39468c3887d99fe6b621d9a50b3d2994af4904787e698fa9ce34e79ae2c4123
6
+ metadata.gz: 3bea1e564a550a72cf7164e3cce4fb7710478e3683c8a1067b1dfc790b87679a59f4a03985fdf610628deeb4334d0d5bd540391afb85d4a41cbb85b67f323525
7
+ data.tar.gz: bc6bba426b31b48d20caa8ebbfa88e3ec3237b51faa8ac520e715c73fdedf18c1807eff59932e512200d47ed0fb7e921c0ca10b2cd5531cba5cc0096487f6323
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- ![build](https://github.com/vfonic/webflow_sync/workflows/build/badge.svg)
1
+ [![Build Status](https://github.com/vfonic/webflow_sync/workflows/build/badge.svg)](https://github.com/vfonic/webflow_sync/actions)
2
+
2
3
 
3
4
  # WebflowSync
4
5
 
@@ -8,9 +8,9 @@ module WebflowSync
8
8
  included do
9
9
  attr_accessor :skip_webflow_sync
10
10
 
11
- after_create :create_webflow_item
12
- after_update :update_webflow_item
13
- after_destroy :destroy_webflow_item
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 ||= !Rails.env.production?
12
+ defined?(self.configuration.skip_webflow_sync) or self.configuration.skip_webflow_sync = !Rails.env.production?
13
13
  end
14
14
 
15
15
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WebflowSync
4
- VERSION = '0.2.4'
4
+ VERSION = '1.1.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: 0.2.4
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-02-10 00:00:00.000000000 Z
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.3
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.