Revision a4b8e182
Added by Tomer Brisker almost 5 years ago
app/models/taxonomy.rb | ||
---|---|---|
def self.ignore?(taxable_type)
|
||
current_taxonomies = if self.current.nil? && User.current.present?
|
||
# "Any context" - all available taxonomies"
|
||
User.current.public_send(self.to_s.underscore.pluralize)
|
||
User.current.public_send("my_#{self.to_s.underscore.pluralize}")
|
||
else
|
||
self.current
|
||
[ self.current ]
|
||
end
|
||
Array.wrap(current_taxonomies).each do |current|
|
||
return true if current.ignore?(taxable_type)
|
||
current_taxonomies.compact.any? do |current|
|
||
current.ignore?(taxable_type)
|
||
end
|
||
false
|
||
end
|
||
|
||
# if taxonomy e.g. organization was not set by current context (e.g. Any organization)
|
||
... | ... | |
end
|
||
|
||
def ignore?(taxable_type)
|
||
if ignore_types.empty?
|
||
false
|
||
else
|
||
ignore_types.include?(taxable_type.classify)
|
||
end
|
||
ignore_types.include?(taxable_type.classify)
|
||
end
|
||
|
||
def self.all_import_missing_ids
|
Also available in: Unified diff
Fixes #27705 - Simplify Taxonomy.ignore? logic