Problem
On branch set-up-an-avo-installer-rake, lib/tasks/templates/avo/filters/post_type_filter.rb.tt:
post_type = PostType.find_by(name: value)
return query if post_type.nil?
query.by_post_type(post_type)
by_post_type (lib/bunko/models/post_methods.rb:36) filters by post_types: {name: type_name} — passing a record means the filter silently matches nothing.
Proposed solution
Use query.where(post_type: post_type) (or pass post_type.name).
Acceptance criteria
- Selecting a post type in the Avo filter actually filters the index (test in
test/tasks/bunko_avo_task_test.rb or an integration test).
Problem
On branch
set-up-an-avo-installer-rake,lib/tasks/templates/avo/filters/post_type_filter.rb.tt:by_post_type(lib/bunko/models/post_methods.rb:36) filters bypost_types: {name: type_name}— passing a record means the filter silently matches nothing.Proposed solution
Use
query.where(post_type: post_type)(or passpost_type.name).Acceptance criteria
test/tasks/bunko_avo_task_test.rbor an integration test).