smezae said over 2 years ago on Roles from Scratch :
What about the Rolify gem? it is much more simple and you can combine it with cancancan

David Kimura PRO said over 2 years ago on Roles from Scratch :
The Rolify gem is great if the complexity is needed. Otherwise, I feel like this is a simple enough implementation that would accomplish many use cases as well as not introduce another dependency.

konung PRO said over 2 years ago on Roles from Scratch :
Hi 
at 11:55

# .any?  -> Takes a block and enumerates

role.map(&:editable?).any? 

#  This is easier to read IMHO.  :) 
role.any?(&:editable?) 

David Kimura PRO said over 2 years ago on Roles from Scratch :
ah.. like it!

Login to Comment