[Rails] Re: rails array.each returning array?

2009-02-27 Thread Starr Horne
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

[Rails] Re: rails array.each returning array?

2009-02-27 Thread Maurício Linhares
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

[Rails] Re: rails array.each returning array?

2009-02-27 Thread Sergio Ruiz
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