2023-07-20 17:58:21 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Permite traer los cambios cada vez que se
|
|
|
|
# hace un push al repositorio
|
|
|
|
class GitPullJob < ApplicationJob
|
|
|
|
# @param :site [Site]
|
2023-07-21 20:12:26 +00:00
|
|
|
# @param :usuarie [Usuarie]
|
2023-07-20 17:58:21 +00:00
|
|
|
# @return [nil]
|
2023-07-27 19:46:32 +00:00
|
|
|
def perform(site, usuarie, message)
|
2023-07-20 17:58:21 +00:00
|
|
|
site.repository.fetch
|
2023-07-27 19:46:32 +00:00
|
|
|
site.repository.merge(usuarie, message) if site.repository.fetch&.positive?
|
2023-07-20 17:58:21 +00:00
|
|
|
end
|
2023-07-21 20:12:26 +00:00
|
|
|
end
|