Various code cleaning, mainly on User, Permission and IssueStatus models.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@414 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2007-04-04 17:26:05 +00:00
1 parent a9a082f05c
commit e227b92972
8 files changed
+23 -33

No files matched your search

+2 -8
View File
@@ -124,14 +124,8 @@ class User < ActiveRecord::Base
User.hash_password(clear_password) == self.hashed_password
end
def role_for_project(project_id)
@role_for_projects ||=
begin
roles = {}
self.memberships.each { |m| roles.store m.project_id, m.role_id }
roles
end
@role_for_projects[project_id]
def role_for_project(project)
memberships.detect {|m| m.project_id == project.id}
end
def pref