2012-07-19 18:01:29 -04:00
|
|
|
class SystemHookObserver < ActiveRecord::Observer
|
|
|
|
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)
|
2013-02-20 05:53:15 -05:00
|
|
|
SystemHooksService.execute_hooks_for(model, :create)
|
2012-07-19 18:01:29 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def after_destroy(model)
|
2013-02-20 05:53:15 -05:00
|
|
|
SystemHooksService.execute_hooks_for(model, :destroy)
|
2012-07-19 18:01:29 -04:00
|
|
|
end
|
|
|
|
end
|