Commit dda43093d5b99b19f6b031dfe39910bc6f8b1ca0
1 parent
1e99747b
Exists in
master
and in
1 other branch
Made Searchkick.load_model public [skip ci]
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
README.md
... | ... | @@ -1645,7 +1645,7 @@ class ReindexConversionsJob < ApplicationJob |
1645 | 1645 | end |
1646 | 1646 | |
1647 | 1647 | # update column |
1648 | - model = class_name.constantize | |
1648 | + model = Searchkick.load_model(class_name) | |
1649 | 1649 | model.transaction do |
1650 | 1650 | conversions_by_record.each do |id, conversions| |
1651 | 1651 | model.where(id: id).update_all(search_conversions: conversions) | ... | ... |
lib/searchkick.rb
... | ... | @@ -285,7 +285,7 @@ module Searchkick |
285 | 285 | relation |
286 | 286 | end |
287 | 287 | |
288 | - # private | |
288 | + # public (for reindexing conversions) | |
289 | 289 | def self.load_model(class_name, allow_child: false) |
290 | 290 | model = class_name.safe_constantize |
291 | 291 | raise Error, "Could not find class: #{class_name}" unless model | ... | ... |