2012-03-04 14:35:15 +01:00
|
|
|
class ProjectObserver < ActiveRecord::Observer
|
|
|
|
def after_save(project)
|
|
|
|
project.update_repository
|
|
|
|
end
|
|
|
|
|
|
|
|
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
|