/ Published in: Ruby
Expand |
Embed | Plain Text
@users.all?{ |user| user.activated == 1 } # или даже так: @users.all?(&:activated) # при условии что activated принимает значение true/false, т.к. 0 в Ruby считается true @users.any?{ |user| user.activated == 1 }
You need to login to post a comment.
