summaryrefslogtreecommitdiffstats
path: root/app/models/role.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-04-08 17:44:54 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-04-08 17:44:54 +0000
commit183ede84fd80c8d4592869dfb631ec6c2ad58543 (patch)
tree895a304a52c2873fb27a7bc7d8be86f0f50d7fb8 /app/models/role.rb
parentbd9a44c2254ab785014207cb07f8b2fff1068b34 (diff)
downloadredmine-183ede84fd80c8d4592869dfb631ec6c2ad58543.tar.gz
redmine-183ede84fd80c8d4592869dfb631ec6c2ad58543.zip
Various changes on views. On project summary, members are now grouped by role and subprojects are listed inline.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@434 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/role.rb')
-rw-r--r--app/models/role.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/role.rb b/app/models/role.rb
index 7798f3bc6..a60319c55 100644
--- a/app/models/role.rb
+++ b/app/models/role.rb
@@ -26,6 +26,10 @@ class Role < ActiveRecord::Base
validates_uniqueness_of :name
validates_format_of :name, :with => /^[\w\s\'\-]*$/i
+ def <=>(role)
+ position <=> role.position
+ end
+
private
def check_integrity
raise "Can't delete role" if Member.find(:first, :conditions =>["role_id=?", self.id])