Project

General

Profile

Actions

Patch #12078

closed

User#allowed_to? should return true or false

Added by Anonymous about 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Low
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

The attached patch fixes a minor bug in User.allowed_to?

Specifically, that method should return a boolean, but it actually sometimes returns a Role instead. This is because .detect is used when really .any? should be used.

I am not aware of this causing any serious issues, but I noticed this during debugging and was greatly confused when allowed_to? suddenly returned a Role ;).


Files

0001-Replace-incorrect-.detect-call-by-.any.patch (1.13 KB) 0001-Replace-incorrect-.detect-call-by-.any.patch Patch changing .detect to .any? Anonymous, 2012-10-11 16:31
Actions

Also available in: Atom PDF