Commit c4f9339a4b1f0dac918fa2534e2014af9d4ab67e
1 parent
82efbb48
Exists in
master
and in
19 other branches
Raise ArgumentError for unknown callbacks value
Showing
1 changed file
with
2 additions
and
0 deletions
Show diff stats
lib/searchkick/model.rb
@@ -67,6 +67,8 @@ module Searchkick | @@ -67,6 +67,8 @@ module Searchkick | ||
67 | end | 67 | end |
68 | 68 | ||
69 | callbacks = options.key?(:callbacks) ? options[:callbacks] : true | 69 | callbacks = options.key?(:callbacks) ? options[:callbacks] : true |
70 | + raise ArgumentError, "Unknown value for callbacks" unless [true, false, :async, :queue].include?(callbacks) | ||
71 | + | ||
70 | if callbacks | 72 | if callbacks |
71 | if respond_to?(:after_commit) | 73 | if respond_to?(:after_commit) |
72 | after_commit :reindex | 74 | after_commit :reindex |