Module: FullSearch::BulkImport
- Defined in:
- lib/full_search/bulk_import.rb
Class Method Summary collapse
- .bulk_import(model) ⇒ Object
- .bulk_importing?(model) ⇒ Boolean
- .end_bulk_import(model) ⇒ Object
- .start_bulk_import(model) ⇒ Object
Class Method Details
.bulk_import(model) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/full_search/bulk_import.rb', line 6 def bulk_import(model) start_bulk_import(model) yield ensure end_bulk_import(model) end |
.bulk_importing?(model) ⇒ Boolean
24 25 26 |
# File 'lib/full_search/bulk_import.rb', line 24 def bulk_importing?(model) models_in_bulk_import.include?(model) end |
.end_bulk_import(model) ⇒ Object
18 19 20 21 22 |
# File 'lib/full_search/bulk_import.rb', line 18 def end_bulk_import(model) models_in_bulk_import.delete(model) FullSearch::Index.create_triggers!(model) FullSearch::BackfillJob.perform_later(model.name) end |
.start_bulk_import(model) ⇒ Object
13 14 15 16 |
# File 'lib/full_search/bulk_import.rb', line 13 def start_bulk_import(model) models_in_bulk_import << model FullSearch::Index.drop_triggers!(model) end |