Skip to content

Commit

Permalink
Merge pull request #40 from dbwinger/dupe-publish-targets
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen authored Feb 5, 2024
2 parents b83bb2d + caabcce commit dd5a9c8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/alchemy/pg_search/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ class Engine < ::Rails::Engine
Alchemy::PagesController.send(:include, Alchemy::PgSearch::ControllerMethods)
Alchemy::Admin::PagesController.send(:include, Alchemy::PgSearch::ControllerMethods)

# reindex the page after it was published
Alchemy.publish_targets << Alchemy::PgSearch::IndexPageJob

# In development environment, this runs on every code reload, so avoid multiple reindexing jobs
unless Alchemy.publish_targets.map(&:name).include? 'Alchemy::PgSearch::IndexPageJob'
# reindex the page after it was published
Alchemy.publish_targets << Alchemy::PgSearch::IndexPageJob
end
# enable searchable flag in page form
Alchemy.enable_searchable = true

Expand Down

0 comments on commit dd5a9c8

Please sign in to comment.