Skip to content

Refactor zones#530

Merged
jhawthorn merged 3 commits intomasterfrom
unknown repository
Jan 20, 2016
Merged

Refactor zones#530
jhawthorn merged 3 commits intomasterfrom
unknown repository

Conversation

@mamhoff
Copy link
Copy Markdown
Contributor

@mamhoff mamhoff commented Nov 23, 2015

Adds a method to find all zones with shared members (which will really help in finding out which tax rates apply for a particular zone, even if those rates' zone encompasses more territory than the zone in question).

This method includes a complex SQL query that Spree::Zone#match also does. Moved to a scope.

Furthermore, improve the documentation so it's somewhat easier to find out what all these things do.

@cbrunsdon
Copy link
Copy Markdown
Contributor

The first commit here is covered by #529, maybe shoot this PR at that branch instead?

@mamhoff
Copy link
Copy Markdown
Contributor Author

mamhoff commented Nov 24, 2015

I'd like to, but Github doesn't let me. Would it be an option to create a branch for the VAT refactoring, and I just point all my PRs to that?

@mamhoff
Copy link
Copy Markdown
Contributor Author

mamhoff commented Nov 24, 2015

Rebased.

@cbrunsdon
Copy link
Copy Markdown
Contributor

👍, good by me.

mamhoff and others added 3 commits January 13, 2016 14:26
This class method returns all those zones that have at least one member
in common (even via a state that is part of a country).
Both Spree::Zone.match and Spree::Zone.with_shared_members employ almost
the same SQL for doing what they need to do. Moved into a named scope to
reduce understanding effort.

Improve documentation, follow Rubocop recommendations
@mamhoff
Copy link
Copy Markdown
Contributor Author

mamhoff commented Jan 13, 2016

Sped up Spree::Zone.with_shared_members a little, and rebase on current master.

@jhawthorn
Copy link
Copy Markdown
Contributor

👍

jhawthorn added a commit that referenced this pull request Jan 20, 2016
@jhawthorn jhawthorn merged commit a05670f into solidusio:master Jan 20, 2016
@mamhoff mamhoff mentioned this pull request Mar 16, 2016
23 tasks
@mamhoff mamhoff deleted the refactor-zones branch May 24, 2016 19:42
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.

3 participants