Skip to content
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

Migrate unfeasibility explanation #1853

Merged

Conversation

voodoorai2000
Copy link

Context

We already have budget investment for every corresponding spending proposal.

However the unfeasibility_explanation attribute was not migrated correctly. This raises a validation error when trying to update any other attribute in these budget investments.

Objectives

Migrate this attribute for all relevant budget investments to make them valid so that we can continue working on migrating supports and ballots.

Does this PR need a Backport to CONSUL?

Yes, this will be important for the final migration

Notes

Adding some debug information in a method, to prevent the rake task from stopping early. If something is printed the ssh connection stays open.

require "rails_helper"
require "migrations/spending_proposal/budget_investments"

describe Migrations::SpendingProposal::BudgetInvestments do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSpec/FilePath: Spec path should end with migrations/spending_proposal/budget_investments*_spec.rb. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Hound 😌 We'll fix this in a separate PR 👌

require "rails_helper"
require "migrations/spending_proposal/budget_investment"

describe Migrations::SpendingProposal::BudgetInvestment do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSpec/FilePath: Spec path should end with migrations/spending_proposal/budget_investment*_spec.rb. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Hound 😌 We'll fix this in a separate PR 👌

We already have budget investment for every corresponding spending proposal. However this attribute was not migrated correctly, creating a validation error when trying to update these budget investments.

With this commit all budget investmetns should be valid and we can continue working on migration supports and ballots.
@voodoorai2000 voodoorai2000 force-pushed the spending_proposals_to_budget_investments branch from ab60c4d to 12b8ffd Compare January 30, 2019 13:59
There are some spending proposals that use either the price_explanation or the internal_comments to explain why a spending proposal is unfeasible.

We must use these attributes to fill in the unfeasible_explanation of a budget investment, otherwise they would still have a validation error.
migration.update

budget_investment.reload
expect(budget_investment.unfeasibility_explanation).to eq("price explanation saying it is too expensive")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [111/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)

@voodoorai2000 voodoorai2000 merged this pull request into spending_proposals Feb 7, 2019
@voodoorai2000 voodoorai2000 deleted the spending_proposals_to_budget_investments branch February 7, 2019 10:09
voodoorai2000 added a commit that referenced this pull request Feb 7, 2019
We now have a dependency on this spec, added in a previous PR[1].

This is due the spec indirectly creating a Comment object[1] that requires the spending proposal to have an administrator.

We could separate the rake task to deal with the initial PR requirements and this PR's requirements. But we should put it all in a single rake task when everything is ready. So just fixing the spec for now.

[1] #1853
voodoorai2000 added a commit that referenced this pull request Mar 5, 2019
We now have a dependency on this spec, added in a previous PR[1].

This is due the spec indirectly creating a Comment object[1] that requires the spending proposal to have an administrator.

We could separate the rake task to deal with the initial PR requirements and this PR's requirements. But we should put it all in a single rake task when everything is ready. So just fixing the spec for now.

[1] #1853
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants