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

Locations many categories #178

Merged
merged 5 commits into from
Apr 5, 2018
Merged

Conversation

mak001
Copy link
Contributor

@mak001 mak001 commented Mar 8, 2018

Resolves #176

@@ -212,9 +212,7 @@ public function getShowRadius()
*/
public function getCategories()
Copy link
Member

Choose a reason for hiding this comment

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

Is this method still needed if it's no longer altering the relation list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The alteration has been added back in. A typo in a relation array caused the initial problem.


$ct = 0;

$convert = function (DataObject $location) use (&$ct) {
Copy link
Member

Choose a reason for hiding this comment

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

Let's add some checks for instances where a location might not have a category. Could skip the add code then. Also work in some memoization to reduce the number of calls to the db for the categories.

mak001 added 2 commits April 4, 2018 17:18
Attempted to batch add categories to locations
Fixed typo in `belongs_many_many`
Updated php docs
@codecov
Copy link

codecov bot commented Apr 5, 2018

Codecov Report

Merging #178 into master will increase coverage by 0.63%.
The diff coverage is 83.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #178      +/-   ##
============================================
+ Coverage      72.9%   73.54%   +0.63%     
- Complexity       83       93      +10     
============================================
  Files             7        7              
  Lines           299      310      +11     
============================================
+ Hits            218      228      +10     
- Misses           81       82       +1
Impacted Files Coverage Δ Complexity Δ
src/bulkloader/LocationCsvBulkLoader.php 0% <ø> (ø) 2 <0> (ø) ⬇️
src/admin/LocationAdmin.php 0% <ø> (ø) 4 <0> (ø) ⬇️
src/objects/Location.php 100% <ø> (ø) 10 <0> (ø) ⬇️
src/objects/LocationCategory.php 100% <100%> (ø) 7 <1> (+1) ⬆️
src/pages/Locator.php 96.77% <100%> (ø) 19 <0> (ø) ⬇️
src/pages/LocatorController.php 57.5% <50%> (ø) 32 <0> (ø) ⬇️
src/form/LocatorForm.php 82% <0%> (+3.05%) 19% <0%> (+9%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b103c12...a8dea87. Read the comment docs.

@mak001 mak001 removed the Don't Merge label Apr 5, 2018
Copy link
Member

@muskie9 muskie9 left a comment

Choose a reason for hiding this comment

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

Looks good, I might play around with the task a bit to see if there's any additional optimizations we could make, but I think this is in a good spot to merge.

@mak001 mak001 merged commit 8d74191 into dynamic:master Apr 5, 2018
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.

2 participants