##// END OF EJS Templates
Replaces repository_enable named scope on Project with a more generic one: has_module....
Jean-Philippe Lang -
r1803:231e98f0c758
parent child
Show More
@@ -24,7 +24,7 class SysController < ActionController::Base
24 24
25 25 # Returns the projects list, with their repositories
26 26 def projects_with_repository_enabled
27 Project.repository_enabled(:all, :include => :repository, :order => 'identifier')
27 Project.has_module(:repository).find(:all, :include => :repository, :order => 'identifier')
28 28 end
29 29
30 30 # Registers a repository for the given project identifier
@@ -63,7 +63,7 class Project < ActiveRecord::Base
63 63
64 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 68 def identifier=(identifier)
69 69 super unless identifier_frozen?
General Comments 0
You need to be logged in to leave comments. Login now