Scoped_label? method raises an exception on admin labels page
Summary
scoped_label?
method in ee/app/models/ee/label.rb
expects that label's subject
(project or group) is always present, but on admin labels page subject
is not available because in admin area all labels are "generic".
Steps to reproduce
Go to /admin/labels
page and create a scoped label (e.g. test::val1
)
What is the current bug behavior?
NameError - undefined local variable or method `subject' for #<Label id:48 ~48>:
ee/app/models/ee/label.rb:10:in `scoped_label?'
ee/app/helpers/ee/labels_helper.rb:7:in `render_label'
app/views/shared/_label_row.html.haml:11:in `_app_views_shared__label_row_html_haml___1371220551369956563_312603660'
app/views/admin/labels/_label.html.haml:2:in `_app_views_admin_labels__label_html_haml___2298335883287347517_278819040'
app/views/admin/labels/index.html.haml:13:in `_app_views_admin_labels_index_html_haml___4098193570292770053_277556880'
app/controllers/application_controller.rb:116:in `render'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:434:in `set_locale'
What is the expected correct behavior?
Scoped labels are displayed properly.
This is a regression introduced in https://gitlab.com/gitlab-org/gitlab-ee/issues/9175