Revision 82b4749e
Added by Marek Hulán about 10 years ago
app/models/filter.rb | ||
---|---|---|
end
|
||
end
|
||
|
||
def allows_organization_filtering?
|
||
granular? && resource_class.allows_organization_filtering?
|
||
end
|
||
|
||
def allows_location_filtering?
|
||
granular? && resource_class.allows_location_filtering?
|
||
end
|
||
|
||
def search_condition
|
||
searches = [self.search, self.taxonomy_search].compact
|
||
searches = searches.map { |s| parenthesize(s) } if searches.size > 1
|
||
... | ... | |
orgs = build_taxonomy_search_string('organization')
|
||
locs = build_taxonomy_search_string('location')
|
||
|
||
orgs = [] if !granular? || !resource_class.allows_organization_filtering?
|
||
locs = [] if !granular? || !resource_class.allows_location_filtering?
|
||
|
||
if self.organizations.empty? && self.locations.empty?
|
||
self.taxonomy_search = nil
|
||
else
|
Also available in: Unified diff
Fixes #5664 - Host filters can use taxonomies
Also disables taxonomy filters on resources that do not support them.