diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-04-08 15:47:20 +0200 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-04-08 15:47:20 +0200 |
commit | 8732e4464039578c070bd28b8a74b25c71a087fd (patch) | |
tree | 60f5c1c5a6285c88647db9ac9a7c952c5abfa6e9 | |
parent | a4a95c7ae27ce9708afb340b46be403c16cc2fd5 (diff) | |
download | sonarqube-8732e4464039578c070bd28b8a74b25c71a087fd.tar.gz sonarqube-8732e4464039578c070bd28b8a74b25c71a087fd.zip |
SONAR-5003 Make options behave as described in WidgetProperty Javadoc (logical or => logical and)
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb index b800be80d62..34fd3326d7e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb @@ -123,7 +123,7 @@ module PropertiesHelper def metrics_filtered_by(options) Metric.all.select(&:display?).sort_by(&:short_name).select do |metric| - options.blank? || options.any? { |option| metric_matches(metric, option) } + options.blank? || options.all? { |option| metric_matches(metric, option) } end end @@ -133,7 +133,6 @@ module PropertiesHelper elsif /domain:(.*)/.match(option) Regexp.new(Regexp.last_match(1)).match(metric.domain) elsif /type:(.*)/.match(option) - false Regexp.last_match(1).split(',').any? { |type| (type == metric.value_type) || ((type == 'NUMERIC') && metric.numeric?) } else false |