diff options
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/models/profile.rb | 9 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb | 2 |
2 files changed, 7 insertions, 4 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 ca469daa5e0..a9eb887503f 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 @@ -169,9 +169,12 @@ class Profile < ActiveRecord::Base child.parent_name=new_name child.save end - # PROPERTIES.TEXT_VALUE is CLOB but not VARCHAR. The operator '=' is supported by all the databases except Oracle. For this reason 'like' must be used. - # Repeat avec me : Oracle rocks. - Property.update_all({:text_value => new_name}, ['prop_key=? and text_value like ?', "sonar.profile.#{language}", old_name]) + Property.with_key("sonar.profile.#{language}").each do |prop| + if prop.text_value==old_name + prop.text_value=new_name + prop.save + end + end end end self diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb index 1189d89009f..0bd3305bdf9 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb @@ -49,7 +49,7 @@ </td> <td align="right" width="10%"> - <span id="activated_rules_<%= u profile.key -%>"><%= profile.active_rules.count -%></span> + <span id="activated_rules_<%= u profile.key -%>"><%= profile.count_active_rules -%></span> </td> <td align="right" width="10%"><span id="alerts_<%= u profile.key -%>"><%= profile.alerts.size -%></span></td> |