end
def destroy
- unless @redaction.old_nodes.empty? &&
- @redaction.old_ways.empty? &&
- @redaction.old_relations.empty?
- flash[:error] = t('redaction.destroy.not_empty')
- redirect_to @redaction
- else
+ if @redaction.old_nodes.empty? &&
+ @redaction.old_ways.empty? &&
+ @redaction.old_relations.empty?
if @redaction.destroy
flash[:notice] = t('redaction.destroy.flash')
redirect_to :redactions
flash[:error] = t('redaction.destroy.error')
redirect_to @redaction
end
+ else
+ flash[:error] = t('redaction.destroy.not_empty')
+ redirect_to @redaction
end
end