2012-03-04 08:35:15 -05:00
|
|
|
class ProjectObserver < ActiveRecord::Observer
|
2012-11-21 00:54:05 -05:00
|
|
|
def after_create(project)
|
2012-03-04 08:35:15 -05:00
|
|
|
project.update_repository
|
|
|
|
end
|
|
|
|
|
2012-12-20 15:16:51 -05:00
|
|
|
def after_update(project)
|
|
|
|
project.send_move_instructions if project.namespace_id_changed?
|
2012-11-21 00:54:05 -05:00
|
|
|
end
|
|
|
|
|
2012-03-04 08:35:15 -05:00
|
|
|
def after_destroy(project)
|
2012-09-11 16:24:53 -04:00
|
|
|
log_info("Project \"#{project.name}\" was removed")
|
|
|
|
|
2012-03-04 08:35:15 -05:00
|
|
|
project.destroy_repository
|
|
|
|
end
|
2012-09-11 16:24:53 -04: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 08:35:15 -05:00
|
|
|
end
|