summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
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