items.each { |item| item.stuff? } if current_user.admin?

On May 27, 6:17 pm, Mario Gr <[email protected]> wrote:
> Is there a  way to combine if and do into a single line?
>
> items.each do |item| if current_user.admin?
>   #do stuff
> end
>
> Thanks!
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to