Replaces repository_enable named scope on Project with a more generic one: has_module.

The new named scope uses raw sql condition to avoid enabled_modules association loading.

git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1805 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-09-13 10:37:23 +00:00
parent c77d9712ca
commit 231e98f0c7
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ class Project < ActiveRecord::Base
before_destroy :delete_all_members
named_scope :repository_enabled, { :include => :enabled_modules, :conditions => ["#{EnabledModule.table_name}.name=?", 'repository'] }
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] } }
def identifier=(identifier)
super unless identifier_frozen?