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

Delegate to MarriageAbroadDataQuery from MarriageAbroadCalculator #2346

Conversation

chrisroos
Copy link
Contributor

This supersedes PRs #2298 and #2316.

My main motivation in this branch is to have a single object that encapsulates all the logic required by the marriage-abroad flow and views. I've updated the flow and views so that we always access methods on MarriageAbroadDataQuery via their wrapper methods on MarriageAbroadCalculator.

In PR #2298 I'd started to rename some of the methods in an attempt to better reflect their purpose. This was proving quite difficult so I'm now using the original MarrageAbroadDataQuery method names in most cases.

This branch was reviewed in both #2298 and #2316 and has now been rebased on master. I'm going to merge once the tests pass.

chrisroos added 28 commits March 9, 2016 10:35
I think this is going to make it easier to make changes as I move
methods move from the `MarriageAbroadDataQuery` to the
`MarriageAbroadCalculator`.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
…ountry?

I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

Interestingly we have another, different, concept of Commonwealth
countries in `RegistrationsDataQuery`. I've made a separate note to
investigate that.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.

For reference, the `#ss_unknown_no_embassies?` method was introduced in
6a9a7b8.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
I want the `MarriageAbroadCalculator` to encapsulate all the logic
required by the flow and views. Delegating to the
`MarriageAbroadDataQuery` for this method is a step toward that goal.

I'm sure the name of this method can be improved but I'm not 100% sure
what it means at the moment, so the renaming will have to wait.
The _what_you_need_to_do partial doesn't use `data_query`.
All access of the `MarriageAbroadDataQuery` is now done via the
`MarriageAbroadCalculator` so we no longer need to instantiate this
`data_query` in the flow.
All regression tests are passing so I'm happy to update the checksum
data.

Updated using:

    $ rails r script/generate-checksums-for-smart-answer.rb \
    marriage-abroad
chrisroos added a commit that referenced this pull request Mar 9, 2016
…ta-query-from-marriage-abroad-calculator

Delegate to MarriageAbroadDataQuery from MarriageAbroadCalculator
@chrisroos chrisroos merged commit baae500 into master Mar 9, 2016
@chrisroos chrisroos deleted the delegate-to-marriage-abroad-data-query-from-marriage-abroad-calculator branch March 9, 2016 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant