does anyone know where the = [a, b, c] is coming from?
It's only doing that in the console, because the return value of each is the
array you passed it. If you run this code outside of irb, you won't see it.
SH
--~--~-~--~~~---~--~~
You received this message
What you want is map, not each (the ruby-doc is always your friend):
def self.show_pending_users
self.find(:all, :conditions = pending_role is not null).map {|x|
#{x.login} }
end
-
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)
On Fri, Feb
Maurício Linhares wrote:
What you want is map, not each (the ruby-doc is always your friend):
ah!
this ended up working perfectly..
thanks so much everyone...
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because
3 matches
Mail list logo