summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Sørensen <johan@johansorensen.com>2009-01-27 11:44:21 +0100
committerJohan Sørensen <johan@johansorensen.com>2009-04-22 12:54:49 +0200
commit069643da73166bae527d7f3451454695edd3b469 (patch)
tree904dd09ebcc34ab5c7f016907f64c06613514b2d
parentb4bf534ee2be1a410784e968a870bba21378b795 (diff)
downloadgitorious-mainline-outdated-069643da73166bae527d7f3451454695edd3b469.zip
gitorious-mainline-outdated-069643da73166bae527d7f3451454695edd3b469.tar.gz
gitorious-mainline-outdated-069643da73166bae527d7f3451454695edd3b469.tar.bz2
Fixed User#repositores association
-rw-r--r--app/models/user.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 37f9a30..89de001 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -21,14 +21,13 @@ require 'digest/sha1'
class User < ActiveRecord::Base
has_many :projects
- has_many :committerships
- has_many :repositories, :through => :committerships,
+ has_many :memberships, :dependent => :destroy
+ has_many :groups, :through => :memberships
+ has_many :repositories,
:conditions => ["repositories.kind = ?", Repository::KIND_PROJECT_REPO]
has_many :ssh_keys, :order => "id desc"
has_many :comments
has_many :events, :order => "events.created_at asc", :dependent => :destroy
- has_many :memberships, :dependent => :destroy
- has_many :groups, :through => :memberships
# Virtual attribute for the unencrypted password
attr_accessor :password, :current_password