summaryrefslogtreecommitdiffstats
path: root/app/models/project.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 35e9a2f..343ba98 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -9,7 +9,7 @@ class Project < ActiveRecord::Base
:class_name => "Repository"
has_many :repository_clones, :conditions => ["mainline = ?", false],
:class_name => "Repository"
- has_many :events, :as => :target, :dependent => :destroy
+ has_many :events, :order => "created_at asc"
is_indexed :fields => ["title", "description", "slug"],
:concatenate => [
@@ -133,6 +133,10 @@ class Project < ActiveRecord::Base
}
super({:procs => [info]}.merge(opts))
end
+
+ def create_event(action_id, target, user, data = nil, body = nil)
+ events.create(:action => action_id, :target => target, :user => user, :body => body, :data => data)
+ end
protected
def create_mainline_repository