diff options
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF/app/models/profile.rb')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/models/profile.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/profile.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/profile.rb index d93bf560f35..bf615b3fc64 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/profile.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/profile.rb @@ -48,6 +48,14 @@ class Profile < ActiveRecord::Base new_rule_profile.errors end + def self.find_by_name_and_language(name, language) + Profile.find(:first, :conditions => {:name => name, :language => language}) + end + + def self.find_active_profile_by_language(language) + Profile.find(:first, :conditions => {:default_profile => true, :language => language}) + end + def self.default_profile Profile.find(:first, :conditions => {:default_profile => true}) end |