*/
package org.sonar.server.startup;
-import org.slf4j.LoggerFactory;
import org.sonar.api.database.DatabaseSession;
import org.sonar.api.database.model.MeasureModel;
import org.sonar.api.platform.ServerUpgradeStatus;
}
boolean mustDoPurge() {
- return status.isUpgraded() && status.getInitialDbVersion()<=162;
+ return status.isUpgraded() && status.getInitialDbVersion() <= 162;
}
void doPurge() {
#
def delete
@profile = Profile.find(params[:id])
- if @profile && !@profile.provided? && !@profile.default_profile?
+ if @profile && @profile.deletable?
java_facade.deleteProfile(@profile.id)
flash[:notice]="Profile '#{@profile.name}' is deleted."
end
@active_hash_by_rule_id
end
+ def deletable?
+ !provided? && !default_profile? && children.empty?
+ end
+
def inherited?
parent_name.present?
end
</td>
<td>
- <% if (!(profile.provided?) && !(profile.default_profile?)) %>
+ <% if profile.deletable? %>
<%= button_to "Delete", { :action => 'delete', :id => profile.id }, :class => 'action',
:id => "delete_#{u profile.key}",
:confirm => "Are you sure that you want to delete the profile '#{profile.name}' ?",
<td valign="top" width="300">
<div class="admin">
<% if @profile.provided? %>
- <p>This profile can not be changed.</p>
+ <p>This profile can not be edited.</p>
<% else %>
<h3>Set parent:</h3>