Commit c4f9339a4b1f0dac918fa2534e2014af9d4ab67e

Authored by Andrew
1 parent 82efbb48

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 67 end
68 68  
69 69 callbacks = options.key?(:callbacks) ? options[:callbacks] : true
  70 + raise ArgumentError, "Unknown value for callbacks" unless [true, false, :async, :queue].include?(callbacks)
  71 +
70 72 if callbacks
71 73 if respond_to?(:after_commit)
72 74 after_commit :reindex
... ...