Commit aabf1086 authored by Marcel Hoppe's avatar Marcel Hoppe

Stop hooking if no rabbitmq config exists

parent 298def43
......@@ -3,6 +3,7 @@ module ActiveBunny
module Hooks
def create_model_hooks(except:[], only:nil)
return unless File.exists?(File.join(Rails.root, 'config', 'rabbitmq.yml'))
hooks = (only || [:after_create, :after_update, :after_destroy]) - except
caller_class = self
model_name = self.send(:class_name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment