SonarCommunity/sonar-scm-stats — pull request #4 by DennisHartrampf (2014-01-29 08:43:29+00:00)
Title: Fix widget titles and typo in config

In the project of my company we had an issue with the sonar-scm-stats plugin. Although we set Period #2 to 30 days and configured the widgets to use Period #2 the titles of the widgets were "... from the beginning of the project". A look into our sonar database revealed that the property sonar.scm-stats.period2 in the properties table has a resource_id of NULL. Thus the property could not be read from the widget.html.erb-files by
```ruby
Property.value('sonar.scm-stats.period' + widgetPeriod.to_s, @resource.id)
```
So I added a fallback to look for
```ruby
Property.value('sonar.scm-stats.period' + widgetPeriod.to_s, nil)
```
if the first attempt with resource_id leads to a nil-result.

If the root problem is our database having a resource_id of NULL for the properties, then you can ignore this fix.

This pull-request also contains the fix to a small typo: The "Period #3" in the config page was named "Period #2".