New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Budget::Phases backend #2323
Merged
Merged
Conversation
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
…er to get non-active-phase description
Create a new Budget::Phase model that: * Stablishes a relation with its budget * Stablishes relation with two other Budget::Phases (previous and next) * Validates basic dates range, kind and description rules. * Adds scopes to get the ones enabled as well as each individual phase Create a factory that generates a basic and valid Budget::Phase Create a model spec that checks kind, date range and budget validations.
bertocq
force-pushed
the
feature/budget_phases
branch
from
January 16, 2018 11:18
ef6515e
to
43dff8e
Compare
bertocq
force-pushed
the
feature/budget_phases
branch
from
January 16, 2018 14:21
c250979
to
02d596c
Compare
MariaCheca
approved these changes
Jan 16, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
voodoorai2000
approved these changes
Jan 16, 2018
clairezed
pushed a commit
to CDJ11/CDJ
that referenced
this pull request
Jun 26, 2018
…ases Create Budget::Phases backend
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Where
Budget's phases list partial #2289
Budget change phases automatically #2304
What
We need a new Phase model that holds a lot of info about Budget Phases, (date range, summary, description, if its enabled/disabled...)
We'll be needing some strong validations to maintain the current assumption that there can't be holes in between phases, that means any Budget should always have an active phase. That means consecutive date ranges even when a phase is disabled.
How
Adding a Budget::Phase model that:
Moving Budget's knowledge about Phases to Budget::Phase, and generating all needed Budget::Phase's for a new Budget after creation
Adding a rake task that will generate Budget Phases for all existing Budgets and migrate values from the
description_*
columns to the new Budget::Phase objects. Check Warning section. 43dff8eScreenshots
No front, only backend :D.
Test
Increased Budget model spec and create Budget::Phase model spec
Deployment
Just after deploy run the
budgets:phases:generate_missing
rake task, explanation at next section ⬇️Warnings
rake budgets:phases:generate_missing
task to generate Budget::Phase's for all existing Budgets and migrate values fromdescription_*
columns from budget's table to new budget_phase's description columns. This is a DEPRECATION warning... in release v0.14 those columns will be erased from database and all non-migrated data will be lost!