[Rt-commit] r5900 - in commitbit: .
jesse at bestpractical.com
jesse at bestpractical.com
Sun Sep 10 20:53:04 EDT 2006
Author: jesse
Date: Sun Sep 10 20:53:03 2006
New Revision: 5900
Modified:
commitbit/ (props changed)
commitbit/lib/CommitBit/Model/Project.pm
commitbit/lib/CommitBit/Model/Repository.pm
Log:
r27355 at pinglin: jesse | 2006-09-11 01:45:33 +0100
* Adding 'associated_users' to repository
Modified: commitbit/lib/CommitBit/Model/Project.pm
==============================================================================
--- commitbit/lib/CommitBit/Model/Project.pm (original)
+++ commitbit/lib/CommitBit/Model/Project.pm Sun Sep 10 20:53:03 2006
@@ -14,6 +14,7 @@
column 'root_path' =>
type is 'text';
column 'repository' =>
+ is immutable,
refers_to CommitBit::Model::Repository;
column 'public' =>
Modified: commitbit/lib/CommitBit/Model/Repository.pm
==============================================================================
--- commitbit/lib/CommitBit/Model/Repository.pm (original)
+++ commitbit/lib/CommitBit/Model/Repository.pm Sun Sep 10 20:53:03 2006
@@ -34,6 +34,34 @@
}
+sub associated_users {
+ my $self = shift;
+ my $users = CommitBit::Model::UserCollection->new();
+ my $members = $users->join(
+ alias1 => 'main',
+ column1 => 'id',
+ table2 => 'projectmembers',
+ column2 => 'user'
+ );
+ my $projects = $users->join(
+ alias1 => $members,
+ column1 => 'project',
+ table2 => 'projects',
+ column2 => 'id'
+ );
+ my $repositories = $users->join(
+ alias1 => $projects,
+ column1 => 'repository',
+ table2 => 'repositories',
+ column2 => 'id'
+ );
+ $users->limit(
+ alias => $repositories,
+ column => 'id',
+ value => $self->id
+ );
+ return $users;
+}
# XXX: make sure svn/svnadmin is in path during compile time.
sub _svnadmin {
More information about the Rt-commit
mailing list