webflow_sync 3.1.2 → 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: 0167ac7a16bf2611e4ba460c1365151bad0f4a502d2631d43452f18de030a799
4
- data.tar.gz: 5bca098d13b884570d0188aeff52841daed1c4f9225c129f7b8a41091fb4e5e8
3
+ metadata.gz: 59276bff6afd0f4fd22915ba780edb12d48a48f0dc7969470b66c3872d035993
4
+ data.tar.gz: 3bb7e9bc90c9e3f20f1a59c3735e2eefb4362b2c13f2aa798514991948ff270d
5
5
  SHA512:
6
- metadata.gz: de74a317b6b06e6b94ac2e4454cc32dd29cdca9ecdf1d22861c0d74760ce6a8639fff2bb80fe16a0dee4139b1000d5640ae46fcf7ed6ade9437c3bd0c90346dd
7
- data.tar.gz: 58dcefd1fc8644d42db578a040f49fc1c89be2e24a06c5a7ca04ef2e85ddd65e6dc2fe245d32d4a7017ed66fadb8212b02544f430152ca5b36fd27377b389177
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,24 +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
- # Make sure slug is in the pulural form, and multiple words slug separated by dashes
30
+ # Make sure slug is in the plural form, and multiple words slug separated by dashes
31
31
  collection_slug = self.model_name.collection.underscore.dasherize
32
32
 
33
- WebflowSync::DestroyItemJob.perform_later(collection_slug: collection_slug,
33
+ WebflowSync::DestroyItemJob.perform_later(collection_slug:,
34
34
  webflow_site_id: self.webflow_site_id,
35
35
  webflow_item_id: self.webflow_item_id)
36
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.2'
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.2
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-10-27 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.2.28
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.