P
Paul Roche
Hi, I want to take the value from an each method and place it in a
function call called borrowed, that runs an evaluation on the value
'bor'.
It's plain to see that 'bor' is undefined outside the block. Is there a
way around this?
In simple terms I want to get the value of a certain attribute for each
user and run that value in a function
out = User.findall)
out.each {|bor| bor.books_borrowed}
borrowed.call(bor)
function call called borrowed, that runs an evaluation on the value
'bor'.
It's plain to see that 'bor' is undefined outside the block. Is there a
way around this?
In simple terms I want to get the value of a certain attribute for each
user and run that value in a function
out = User.findall)
out.each {|bor| bor.books_borrowed}
borrowed.call(bor)