reindexar después de mergear
This commit is contained in:
parent
4609ab21b2
commit
7191baff4a
2 changed files with 13 additions and 1 deletions
|
@ -107,7 +107,7 @@ class SitesController < ApplicationController
|
||||||
def merge
|
def merge
|
||||||
authorize site
|
authorize site
|
||||||
|
|
||||||
if site.repository.merge(current_usuarie)
|
if SiteService.new(site: site, usuarie: current_usuarie).merge
|
||||||
flash[:success] = I18n.t('sites.fetch.merge.success')
|
flash[:success] = I18n.t('sites.fetch.merge.success')
|
||||||
else
|
else
|
||||||
flash[:error] = I18n.t('sites.fetch.merge.error')
|
flash[:error] = I18n.t('sites.fetch.merge.error')
|
||||||
|
|
|
@ -61,6 +61,18 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
|
||||||
commit_config(action: :tor)
|
commit_config(action: :tor)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Trae cambios desde la rama remota y reindexa los artículos.
|
||||||
|
#
|
||||||
|
# @return [Boolean]
|
||||||
|
def merge
|
||||||
|
result = site.repository.merge(usuarie)
|
||||||
|
|
||||||
|
# TODO: Implementar callbacks
|
||||||
|
site.try(:index_posts!) if result
|
||||||
|
|
||||||
|
result.present?
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Guarda los cambios de la configuración en el repositorio git
|
# Guarda los cambios de la configuración en el repositorio git
|
||||||
|
|
Loading…
Reference in a new issue