diff --git a/app/models/communication/website/git_file.rb b/app/models/communication/website/git_file.rb index 83607a85dba9224ae7f8ab8264d2f46e2dd155e1..99993d0e5b72ce8fcc5c8fe2258f3f41b6227288 100644 --- a/app/models/communication/website/git_file.rb +++ b/app/models/communication/website/git_file.rb @@ -38,11 +38,20 @@ class Communication::Website::GitFile < ApplicationRecord end def should_create? - !synchronized_with_git? || previous_path.nil? || previous_sha.nil? + !should_destroy? && + ( + !synchronized_with_git? || + previous_path.nil? || + previous_sha.nil? + ) end def should_update? - !path.nil? && (previous_path != path || previous_sha != sha) + !should_destroy? && + ( + previous_path != path || + previous_sha != sha + ) end def should_destroy? diff --git a/app/models/education/school.rb b/app/models/education/school.rb index 84660f7568ec2bf40bdbbb83871d663c8ebc5ecc..9dfad42681b112d3ff8bc87a43fd4aed38e9aac6 100644 --- a/app/models/education/school.rb +++ b/app/models/education/school.rb @@ -46,16 +46,4 @@ class Education::School < ApplicationRecord def git_path_static "data/school.yml" end - - def to_static(github_file) - { - name: name, - address: address, - zipcode: zipcode, - city: city, - country: ISO3166::Country[country].translations[country.downcase], - phone: phone - }.deep_stringify_keys.to_yaml.lines[1..-1].join - end - end