Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

AO3-5273: Fix child queries for bookmark filter data #3197

Merged
merged 1 commit into from Dec 5, 2017

Conversation

Projects
None yet
3 participants
Owner

elzj commented Dec 4, 2017

Issue

https://otwarchive.atlassian.net/browse/AO3-5273

Purpose

Fixes an issue where private bookmarks were being counted in filters if the work/series had other public bookmarks.

Because works/series/external works can have multiple bookmarks, the child filters have to be combined into one query of their own or else incorrect results may be returned.

Testing

See issue.

- { has_child: { type: "bookmark", query: filter } }
+ key = options[:type] == :exclusion ? :exclude : :include
+ child_filters[key] << filter
+ return nil
@houndci-bot

houndci-bot Dec 4, 2017

Redundant return detected.

@@ -0,0 +1,26 @@
+require 'spec_helper'
@houndci-bot

houndci-bot Dec 4, 2017

Missing magic comment # frozen_string_literal: true.

@sarken sarken merged commit 754efba into otwcode:master Dec 5, 2017

3 of 4 checks passed

codeclimate 1 issue to fix
Details
Scrutinizer 3 new issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
hound 2 violations found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment