mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 00:16:22 +00:00
fix: garantizar que el sitio está indexado antes de verlo
This commit is contained in:
parent
3b656f1908
commit
39ea2d25fc
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