public
Description: Gitorious aims to provide a great way of doing distributed opensource code collaboration.
Homepage: http://gitorious.org/projects/gitorious
Clone URL: git://github.com/dysinger/gitorious.git
Destroy events if associated project/user is deleted

Signed-off-by: David A. Cuadrado <krawek@gmail.com>
David A. Cuadrado (author)
Sat May 03 10:40:17 -0700 2008
commit  31340dc25f963c2535161d54aaf17a517542ea0d
tree    a125de159298edeeda088f5b95055e1dee29a3e8
parent  05e4d1d02f49cf2b3c830a0e5e3d9d4b7c9432cb
...
86
87
88
89
 
90
91
92
...
86
87
88
 
89
90
91
92
0
@@ -86,7 +86,7 @@ class ProjectsController < ApplicationController
0
     if @project.can_be_deleted_by?(current_user)
0
       project_title = @project.title
0
       @project.destroy
0
- #current_user.create_event(Action::DELETE_PROJECT, nil, project_title)
0
+# Event.create(:action => Action::DELETE_PROJECT, :user => current_user, :data => project_title) # FIXME: project_id cannot be null
0
     else
0
       flash[:error] = "You're not the owner of this project, or the project has clones"
0
     end
...
9
10
11
12
 
13
14
15
...
9
10
11
 
12
13
14
15
0
@@ -9,7 +9,7 @@ class Project < ActiveRecord::Base
0
     :class_name => "Repository"
0
   has_many :repository_clones, :conditions => ["mainline = ?", false],
0
     :class_name => "Repository"
0
- has_many :events, :order => "created_at asc"
0
+ has_many :events, :order => "created_at asc", :dependent => :destroy
0
   
0
   is_indexed :fields => ["title", "description", "slug"],
0
     :concatenate => [
...
6
7
8
9
 
10
11
12
...
6
7
8
 
9
10
11
12
0
@@ -6,7 +6,7 @@ class User < ActiveRecord::Base
0
   has_many :repositories, :through => :committerships
0
   has_many :ssh_keys, :order => "id desc"
0
   has_many :comments
0
- has_many :events, :order => "events.created_at asc"
0
+ has_many :events, :order => "events.created_at asc", :dependent => :destroy
0
   
0
   # Virtual attribute for the unencrypted password
0
   attr_accessor :password, :current_password

Comments

    No one has commented yet.