2013-03-26 12:11:38 -04:00
|
|
|
class SystemHookObserver < BaseObserver
|
2012-07-19 18:01:29 -04:00
|
|
|
observe :user, :project, :users_project
|
2013-02-20 04:15:56 -05:00
|
|
|
|
2012-07-19 18:01:29 -04:00
|
|
|
def after_create(model)
|
2014-01-15 07:26:05 -05:00
|
|
|
system_hook_service.execute_hooks_for(model, :create)
|
2012-07-19 18:01:29 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def after_destroy(model)
|
2014-01-15 07:26:05 -05:00
|
|
|
system_hook_service.execute_hooks_for(model, :destroy)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def system_hook_service
|
|
|
|
SystemHooksService.new
|
2012-07-19 18:01:29 -04:00
|
|
|
end
|
|
|
|
end
|