@@ -24,7 +24,7 class SysController < ActionController::Base | |||||
24 |
|
24 | |||
25 | # Returns the projects list, with their repositories |
|
25 | # Returns the projects list, with their repositories | |
26 | def projects_with_repository_enabled |
|
26 | def projects_with_repository_enabled | |
27 |
Project.repository |
|
27 | Project.has_module(:repository).find(:all, :include => :repository, :order => 'identifier') | |
28 | end |
|
28 | end | |
29 |
|
29 | |||
30 | # Registers a repository for the given project identifier |
|
30 | # Registers a repository for the given project identifier |
@@ -63,7 +63,7 class Project < ActiveRecord::Base | |||||
63 |
|
63 | |||
64 | before_destroy :delete_all_members |
|
64 | before_destroy :delete_all_members | |
65 |
|
65 | |||
66 | named_scope :repository_enabled, { :include => :enabled_modules, :conditions => ["#{EnabledModule.table_name}.name=?", 'repository'] } |
|
66 | named_scope :has_module, lambda { |mod| { :conditions => ["#{Project.table_name}.id IN (SELECT em.project_id FROM #{EnabledModule.table_name} em WHERE em.name=?)", mod.to_s] } } | |
67 |
|
67 | |||
68 | def identifier=(identifier) |
|
68 | def identifier=(identifier) | |
69 | super unless identifier_frozen? |
|
69 | super unless identifier_frozen? |
General Comments 0
You need to be logged in to leave comments.
Login now