Correctly show finished budgets at budget index #2369
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Currently we're showing all budgets at the "Finished Budgets" section of the Budget's index page. That's not right, only finished ones should be listed there!
How
As a bonus: renaming @Budget usage to @current_budget for extra descriptive variable name 547970e
Screenshots
If you run
rake db:dev_seeds
you'll be able to see both finished budgets listed, but not the accepting one:Test
I started by refactoring the budget feature spec as we're no longer listing all budget's but only finished ones fe90ecb
Then added expectations to see the finished budget at the list but not the current or drafting ones 4e854c0
Removed Drafting budget scenarios no longer valid b24bb2d
And finally made rubocop 🤖 smile by making the file 100 linelength compliant 59e5854
Deployment
As usual
Warnings
Maybe too much refactoring for just 4 lines of code, right? But I'm doing the boyscout here and cleaning as I pass by... Should we start doing separate-but-related PR's to make important changes easier to read? I tried to with the commit history and PR description 🙇