2012-07-20 00:01:29 +02:00
|
|
|
class SystemHookObserver < ActiveRecord::Observer
|
|
|
|
observe :user, :project, :users_project
|
2013-02-20 10:15:56 +01:00
|
|
|
|
2012-07-20 00:01:29 +02:00
|
|
|
def after_create(model)
|
2013-02-20 11:53:15 +01:00
|
|
|
SystemHooksService.execute_hooks_for(model, :create)
|
2012-07-20 00:01:29 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def after_destroy(model)
|
2013-02-20 11:53:15 +01:00
|
|
|
SystemHooksService.execute_hooks_for(model, :destroy)
|
2012-07-20 00:01:29 +02:00
|
|
|
end
|
|
|
|
end
|