Commit a040066c4b09eae52d1aaadcc2a46f85e2903c0a
1 parent
d7312a30
Exists in
master
and in
18 other branches
Added :inline as alias for true for callbacks and mode options - closes #1133
Showing
3 changed files
with
5 additions
and
4 deletions
Show diff stats
CHANGELOG.md
lib/searchkick/model.rb
... | ... | @@ -16,8 +16,8 @@ module Searchkick |
16 | 16 | |
17 | 17 | options[:_type] ||= -> { searchkick_index.klass_document_type(self, true) } |
18 | 18 | |
19 | - callbacks = options.key?(:callbacks) ? options[:callbacks] : true | |
20 | - unless [true, false, :async, :queue].include?(callbacks) | |
19 | + callbacks = options.key?(:callbacks) ? options[:callbacks] : :inline | |
20 | + unless [:inline, true, false, :async, :queue].include?(callbacks) | |
21 | 21 | raise ArgumentError, "Invalid value for callbacks" |
22 | 22 | end |
23 | 23 | ... | ... |
lib/searchkick/record_indexer.rb
... | ... | @@ -8,7 +8,7 @@ module Searchkick |
8 | 8 | end |
9 | 9 | |
10 | 10 | def reindex(method_name = nil, refresh: false, mode: nil) |
11 | - unless [true, nil, :async, :queue].include?(mode) | |
11 | + unless [:inline, true, nil, :async, :queue].include?(mode) | |
12 | 12 | raise ArgumentError, "Invalid value for mode" |
13 | 13 | end |
14 | 14 | |
... | ... | @@ -31,7 +31,7 @@ module Searchkick |
31 | 31 | record.id.to_s, |
32 | 32 | method_name ? method_name.to_s : nil |
33 | 33 | ) |
34 | - else # bulk, true | |
34 | + else # bulk, inline/true | |
35 | 35 | reindex_record(method_name) |
36 | 36 | |
37 | 37 | index.refresh if refresh | ... | ... |