webflow_sync 3.1.0 → 4.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: 2c1e92b51a65d85955a3e252f59660dcf59932a7bcca492c7ce439e660efb762
4
- data.tar.gz: 3befa85279c19ad561d4b5dd15f1fc2446d89238027969739f98a53966ea6897
3
+ metadata.gz: 59276bff6afd0f4fd22915ba780edb12d48a48f0dc7969470b66c3872d035993
4
+ data.tar.gz: 3bb7e9bc90c9e3f20f1a59c3735e2eefb4362b2c13f2aa798514991948ff270d
5
5
  SHA512:
6
- metadata.gz: 35bc4a6a9f7b50ff5b1c5062f1554a37f5b2e12e439d8cead8b07188ab70de0d184499ade1caa0b102668d06332515de580507fce0cd9109e1ff17b0ac871710
7
- data.tar.gz: fbfa04746a2faa8f34b30879589c2857ecf1ab9bd04b907119f5ad6cce702ec2fc5f7e9d441c3c7145b14cf25607aabd717de45abcb359252ab650dc2f3d0e4b
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: 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: 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 || WebflowSync.configuration.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 || WebflowSync.configuration.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 || WebflowSync.configuration.skip_webflow_sync
28
+ return if WebflowSync.configuration.skip_webflow_sync || self.skip_webflow_sync || self.webflow_site_id.blank?
29
29
 
30
- WebflowSync::DestroyItemJob.perform_later(collection_slug: self.model_name.collection,
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: 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: migration_version
15
+ migration_version:
16
16
  end
17
17
 
18
18
  def include_item_sync_in_model_file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WebflowSync
4
- VERSION = '3.1.0'
4
+ VERSION = '4.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: 3.1.0
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: 2021-07-06 00:00:00.000000000 Z
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: '2.6'
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.0.9
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.