Skip to content

Conversation

@adamlazik1
Copy link
Contributor

theforeman/foreman#10370 made changes to filters which must be addressed here for tests to pass.

# console no matter what task it is...
edit_permission = Permission.where(:name => :edit_foreman_tasks, :resource_type => ForemanTasks::Task.name).first
if @user.filters.joins(:filterings).unlimited.where('filterings.permission_id' => edit_permission).first
if @user.filters.joins(:filterings).where('filterings.permission_id' => edit_permission).any? { |f| f.search_condition.blank? }
Copy link
Contributor

Choose a reason for hiding this comment

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

The unlimited scope was originally defined like this:

  scope :unlimited, -> { where(:search => nil, :taxonomy_search => nil) }

I'd prefer to add this to the where condition to keep the behaviour exactly the same as it used to be.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied.

theforeman/foreman#10370 made changes to filters
which must be addressed here for tests to pass.
@adamruzicka adamruzicka merged commit e85eed5 into theforeman:master Oct 24, 2025
24 of 25 checks passed
@adamruzicka
Copy link
Contributor

Thank you @adamlazik1 !

@adamlazik1 adamlazik1 deleted the fix-tests branch October 24, 2025 09:41
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