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

filter_editions doesn't support multiple filters #3079

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

richardTowers
Copy link
Contributor

I added this "temporary" warning back in May last year, but I forgot to make it an error until just now.

The code processing the filters is:

filters.each do |link_type, target_content_id|
  scope = scope.where(links: { link_type:, target_content_id: })
end

... so the .where() statements would be ANDed together. If you provided multiple different filters, you'd never get any results.

I've checked the logs in production, and my warning has not been served in the last 14 days (our log retention), so I'm pretty confident it's safe to tighten this up.

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

This application is owned by the publishing platform team. Please let us know in #govuk-publishing-platform when you raise any PRs.

I added this "temporary" warning back in May last year, but I forgot to
make it an error until just now.

The code processing the filters is:

    filters.each do |link_type, target_content_id|
      scope = scope.where(links: { link_type:, target_content_id: })
    end

... so the .where() statements would be ANDed together. If you provided
multiple different filters, you'd never get any results.

I've checked the logs in production, and my warning has not been served
in the last 14 days (our log retention), so I'm pretty confident it's
safe to tighten this up.
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