diff --git a/app/jobs/git_pull_job.rb b/app/jobs/git_pull_job.rb index dc4a285c..d5b23bdb 100644 --- a/app/jobs/git_pull_job.rb +++ b/app/jobs/git_pull_job.rb @@ -3,11 +3,14 @@ # Permite traer los cambios desde webhooks class GitPullJob < ApplicationJob - # @param :site [Site] - # @param :usuarie [Usuarie] - # @param :message [String] - # @return [nil] - def perform(site, usuarie, message) - site.repository.merge(usuarie, message) if site.repository.fetch&.positive? - end -end \ No newline at end of file + # @param :site [Site] + # @param :usuarie [Usuarie] + # @param :message [String] + # @return [nil] + def perform(site, usuarie, message) + return unless site.repository.fetch.positive? + + site.repository.merge(usuarie, message) + site.reindex_changes! + end +end