The console always prints the return value of the command. And the return value for .eachis the initial array.
So, you either return the desired value:
Model.find(:all).map{ |x| x.name }
Or prevent the output by returning something like nil:
Model.find(:all).each{ |x| p x.name }; nil
Voyta source
share