5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-29 21:26:21 +00:00
panel/app/models/site/index.rb

21 lines
348 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
# Indexa todos los artículos de un sitio
#
# TODO: Hacer opcional
class Site
module Index
extend ActiveSupport::Concern
included do
has_many :indexed_posts, dependent: :destroy
def index_posts!
Site.transaction do
2022-08-03 16:11:06 +00:00
docs.each(&:index!)
end
end
end
end
end