mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-04-20 07:11:33 +02:00
add filter for originator
This commit is contained in:
parent
41ed4a9674
commit
1cf5485356
2 changed files with 5 additions and 2 deletions
|
@ -65,7 +65,9 @@ class Paper < ActiveRecord::Base
|
|||
filter do
|
||||
bool do
|
||||
must { term paper_type: options[:paper_type] } if options[:paper_type]
|
||||
must { match_all } unless options[:paper_type]
|
||||
must { term originator: options[:originator] } if options[:originator]
|
||||
# catchall when no filters set
|
||||
must { match_all } if options.keys.none? {|k| [:paper_type, :originator].include?(k) }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue