mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 15:56:20 +00:00
fix: garantizar que el sitio está indexado antes de verlo
(cherry picked from commit 39ea2d25fc
)
This commit is contained in:
parent
8c50775218
commit
0d781b6a15
3 changed files with 5 additions and 11 deletions
|
@ -96,7 +96,9 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def site
|
||||
@site ||= find_site
|
||||
@site ||= find_site.tap do |s|
|
||||
s.reindex_changes!
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
|
|
@ -6,9 +6,6 @@ class Post
|
|||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
# Indexa o reindexa el Post
|
||||
after_save :index!
|
||||
after_destroy :remove_from_index!
|
||||
|
||||
# @return [IndexedPost,nil]
|
||||
def indexed_post
|
||||
|
|
|
@ -76,16 +76,11 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
|
|||
commit_config(action: :tor)
|
||||
end
|
||||
|
||||
# Trae cambios desde la rama remota y reindexa los artículos.
|
||||
# Trae cambios desde la rama remota
|
||||
#
|
||||
# @return [Boolean]
|
||||
def merge
|
||||
result = site.repository.merge(usuarie)
|
||||
|
||||
# TODO: Implementar callbacks
|
||||
site.try(:index_posts!) if result
|
||||
|
||||
result.present?
|
||||
site.repository.merge(usuarie).present?
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in a new issue