From f5908cef19a3cd2c44be02b453fecb568b2c6c8e Mon Sep 17 00:00:00 2001 From: Valeriy Sizov Date: Sun, 15 Jul 2012 15:29:06 +0300 Subject: System Hook: implemented --- app/models/system_hook.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/models/system_hook.rb') diff --git a/app/models/system_hook.rb b/app/models/system_hook.rb index 178b7585d5b..8517d43a9de 100644 --- a/app/models/system_hook.rb +++ b/app/models/system_hook.rb @@ -1,3 +1,13 @@ class SystemHook < WebHook + + def async_execute(data) + Resque.enqueue(SystemHookWorker, id, data) + end + def self.all_hooks_fire(data) + SystemHook.all.each do |sh| + sh.async_execute data + end + end + end -- cgit v1.2.1