diff --git a/app/jobs/git_pull_job.rb b/app/jobs/git_pull_job.rb index dc4a285c..58a4e6b1 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] + # @return [nil] + def perform(site, usuarie) + return unless site.repository.origin + return unless site.repository.fetch.positive? + + site.repository.merge(usuarie) + site.reindex_changes! + end +end