generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the mismatch between headers and rows
In certain circumstances, such as when a report has forecasts but no actual spend, there is an extra column for the data that is not matched to a header. The reason the extra column shows up is due to the data structures used for the actuals and variance, which will always return a hash with keys and values, even if the values are not meaningful (empty arrays or zero values). We cannot simply filter out empty arrays or zero values, because they can be meaningful in other contexts, such as when there are some nil or zero values in some quarters, but they are surrounded by quarters with non-zero values, so we have to include them. The simplest solution is to trust the logic of the headers generation, and not attempt to compute actuals or variance for reports where the app has already determined there are no actuals or variance to display.
- Loading branch information
1 parent
4d892ba
commit 692c4a0
Showing
3 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters