2012-03-04 14:35:15 +01:00
|
|
|
class ProjectObserver < ActiveRecord::Observer
|
2012-11-21 06:54:05 +01:00
|
|
|
def after_create(project)
|
2012-03-04 14:35:15 +01:00
|
|
|
project.update_repository
|
|
|
|
end
|
|
|
|
|
2012-11-21 06:54:05 +01:00
|
|
|
def after_save(project)
|
|
|
|
end
|
|
|
|
|
2012-03-04 14:35:15 +01:00
|
|
|
def after_destroy(project)
|
2012-09-11 22:24:53 +02:00
|
|
|
log_info("Project \"#{project.name}\" was removed")
|
|
|
|
|
2012-03-04 14:35:15 +01:00
|
|
|
project.destroy_repository
|
|
|
|
end
|
2012-09-11 22:24:53 +02:00
|
|
|
|
|
|
|
def after_create project
|
|
|
|
log_info("#{project.owner.name} created a new project \"#{project.name}\"")
|
|
|
|
end
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
def log_info message
|
|
|
|
Gitlab::AppLogger.info message
|
|
|
|
end
|
2012-03-04 14:35:15 +01:00
|
|
|
end
|