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

Merged
merged 1 commit into from
Jan 14, 2025

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.
Copy link
Contributor

@JonathanHallam JonathanHallam left a comment

Choose a reason for hiding this comment

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

Cheers!

@richardTowers richardTowers merged commit ac1235a into main Jan 14, 2025
13 checks passed
@richardTowers richardTowers deleted the make-warning-an-error branch January 14, 2025 10:26
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.

2 participants