Revision a30ab44e
Added by Marek Hulán almost 8 years ago
app/helpers/application_helper.rb | ||
---|---|---|
end
|
||
|
||
def show_parent?(obj)
|
||
(obj.new_record? && obj.class.count > 0) || (!obj.new_record? && obj.class.count > 1)
|
||
minimum_count = obj.new_record? ? 0 : 1
|
||
base = obj.class.respond_to?(:completer_scope) ? obj.class.completer_scope(nil) : obj.class
|
||
base.count > minimum_count
|
||
end
|
||
|
||
def documentation_button(section = "", options = {})
|
Also available in: Unified diff
Fixes #15268 - limit user taxonomies using my scopes
Fixes CVE-2016-4475