Skip to content

Fix #47379 - Project visibility tooltip

What does this MR do?

Modifies the is_a? behaviour of Presenters so that they may also be compared against the classes they're presenting.

The issue is that a ProjectPresenter is being checked in a case statement, where Project is expected. By modifying is_a? to also return true if some_project_presenter.is_a? Project, we're also ensuring that Project === some_project_presenter and, finally, that throwing a project presenter into a case statement will evaluate true when compared against a Project.

This is a very risky MR, and I totally understand if you choose to reject it :-). In a world where we use case comparisons against presenters, though, it means we don't have to worry about whether an actual record or its presenter is being used. Presenters are just wrappers, after all.

Are there points in the code the reviewer needs to double check?

Yeah, all of it. It's a very weird fix.

Why was this MR needed?

Projects' visibility tooltips weren't showing up.

Screenshots (if relevant)

image

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Edited by Rémy Coutable

Merge request reports