summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorJohan Sørensen <johan@johansorensen.com>2007-12-13 23:07:42 +0100
committerJohan Sørensen <johan@johansorensen.com>2007-12-13 23:07:42 +0100
commita9ebd2bc58bb11a5fba462f82460fee83fd4426f (patch)
treed99045110e53fb2d9b6e28c20b07f2f536a2b45b /app/models
parent3a6a9d6525c3bc57babc0a858f1fe4db0b5714f7 (diff)
downloadgitorious-mainline-outdated-a9ebd2bc58bb11a5fba462f82460fee83fd4426f.zip
gitorious-mainline-outdated-a9ebd2bc58bb11a5fba462f82460fee83fd4426f.tar.gz
gitorious-mainline-outdated-a9ebd2bc58bb11a5fba462f82460fee83fd4426f.tar.bz2
rename Permission to Committership
Diffstat (limited to 'app/models')
-rw-r--r--app/models/committership.rb (renamed from app/models/permission.rb)2
-rw-r--r--app/models/repository.rb4
-rw-r--r--app/models/user.rb6
3 files changed, 6 insertions, 6 deletions
diff --git a/app/models/permission.rb b/app/models/committership.rb
index 62a183b..5b1e01f 100644
--- a/app/models/permission.rb
+++ b/app/models/committership.rb
@@ -1,4 +1,4 @@
-class Permission < ActiveRecord::Base
+class Committership < ActiveRecord::Base
belongs_to :user
belongs_to :repository
diff --git a/app/models/repository.rb b/app/models/repository.rb
index d1f6619..f5424b6 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -2,8 +2,8 @@ class Repository < ActiveRecord::Base
belongs_to :user
belongs_to :project
belongs_to :parent, :class_name => "Repository"
- has_many :permissions, :dependent => :destroy
- has_many :committers, :through => :permissions, :source => :user
+ has_many :committerships, :dependent => :destroy
+ has_many :committers, :through => :committerships, :source => :user
validates_presence_of :user_id, :project_id, :name
validates_format_of :name, :with => /^[a-z0-9_\-]+$/i
diff --git a/app/models/user.rb b/app/models/user.rb
index 537b466..09bec3c 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -2,8 +2,8 @@ require 'digest/sha1'
class User < ActiveRecord::Base
has_many :projects
- has_many :permissions
- has_many :repositories, :through => :permissions
+ has_many :committerships
+ has_many :repositories, :through => :committerships
has_many :ssh_keys
# Virtual attribute for the unencrypted password
@@ -88,7 +88,7 @@ class User < ActiveRecord::Base
end
def can_write_to?(repository)
- !!permissions.find_by_repository_id(repository.id)
+ !!committerships.find_by_repository_id(repository.id)
end
def to_param