2012-11-19 18:24:05 +00:00
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: web_hooks
|
|
|
|
#
|
|
|
|
# id :integer not null, primary key
|
|
|
|
# url :string(255)
|
|
|
|
# project_id :integer
|
|
|
|
# created_at :datetime not null
|
|
|
|
# updated_at :datetime not null
|
|
|
|
# type :string(255) default("ProjectHook")
|
|
|
|
#
|
|
|
|
|
2012-07-12 12:36:33 +00:00
|
|
|
class SystemHook < WebHook
|
2012-07-15 12:29:06 +00:00
|
|
|
def self.all_hooks_fire(data)
|
|
|
|
SystemHook.all.each do |sh|
|
|
|
|
sh.async_execute data
|
|
|
|
end
|
|
|
|
end
|
2012-10-09 00:10:04 +00:00
|
|
|
|
|
|
|
def async_execute(data)
|
|
|
|
Resque.enqueue(SystemHookWorker, id, data)
|
|
|
|
end
|
2012-07-12 12:36:33 +00:00
|
|
|
end
|