From 0c00e72c6c6acf8ad8a319aef5596fc487ef73e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com> Date: Mon, 25 Oct 2021 14:31:53 +0200 Subject: [PATCH] refactor --- Gemfile | 1 + app/models/communication/website/imported/post.rb | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 1f264b24e..70d09d033 100644 --- a/Gemfile +++ b/Gemfile @@ -35,6 +35,7 @@ gem 'bootstrap5-kaminari-views' gem 'octokit' gem 'front_matter_parser' gem 'two_factor_authentication', git: 'https://github.com/noesya/two_factor_authentication.git' +# gem 'two_factor_authentication', path: '../two_factor_authentication' # Front gem 'jquery-rails' diff --git a/app/models/communication/website/imported/post.rb b/app/models/communication/website/imported/post.rb index aa83a9b22..16a318248 100644 --- a/app/models/communication/website/imported/post.rb +++ b/app/models/communication/website/imported/post.rb @@ -76,10 +76,10 @@ class Communication::Website::Imported::Post < ApplicationRecord self.post.title = "Untitled" # No title yet self.post.save else - # Don't touch if there are local changes (this would destroy some nice work) - # return if post.updated_at > updated_at - # Don't touch if there are no remote changes (this would do useless server workload) - # return if post.updated_at == updated_at + # Continue only if there are remote changes + # Don't touch if there are local changes (post.updated_at > updated_at) + # Don't touch if there are no remote changes (post.updated_at == updated_at) + # return unless updated_at > post.updated_at end puts "Update post #{post.id}" sanitized_title = Wordpress.clean self.title.to_s -- GitLab