From: Hassan Schroeder Date: 2010-11-14T00:52:40+09:00 Subject: Re: an each/block problem On Sat, Nov 13, 2010 at 7:46 AM, Paul Roche wrote: > I have a table called User which has a books_borrowed column. I'd like > to stick to this lambda if at all possible :) > > > borrowed = lambda do |x| >  if x > 1 then p "you have borrowed too many" >  else puts "you can borrow more" >  end > end Wouldn't that just be: users = User.all users.each {|user| borrowed.call(user.books_borrowed) } ? -- Hassan Schroeder ------------------------ hassan.schroeder@gmail.com twitter: @hassan