#-- # Copyright (C) 2007 Dimitrij Denissenko # Please read LICENSE document for more information. #++ class ProjectObserver < ActiveRecord::Observer observe Project def before_create(project) # Make the project accessible for 'Default' user group project.groups << Group.default_group # Assign project to all groups with global project access project.groups << Group.find_all_by_access_to_all_projects(true) end def after_save(project) # Update revisions cache if the path has changed if project.original_path != project.root_path project.original_path = project.root_path project.update_existing_revisions end end end