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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions app/models/link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ class Link < ApplicationRecord
validate :association_presence

def self.filter_editions(scope, filters)
if filters.size > 1
# TODO: richard.towers - temporary warning to check whether this method is ever
# called with multiple filters. The code looks wrong, so if it's not being
# called we should make this an error and only support a single filter.
logger.warn("filter_editions called with multiple filters. These will be ANDed together in a way that probably isn't what we want. Filters were: #{filters.inspect}")
end
raise "filter_editions doesn't support multiple filters" if filters.size > 1

scope = scope.joins(document: :link_set_links)

Expand Down
Loading