Skip to content

Instantly share code, notes, and snippets.

@elyosemite
Created June 9, 2018 19:08
Show Gist options
  • Select an option

  • Save elyosemite/8982c3f0f745607b195795828f74232f to your computer and use it in GitHub Desktop.

Select an option

Save elyosemite/8982c3f0f745607b195795828f74232f to your computer and use it in GitHub Desktop.
(byebug) produtos
#<ActiveRecord::Result:0x95c1b0c
@columns=["id", "nome"],
@rows=[
[1, "yuri"],
[2, "Igor"],
[3, "Iran"],
[4, "Hotaviano"],
[5, "Maria"],
[6, "José"],
[7, "Mateus"],
[8, "kaun"]
],
@hash_rows=nil,
@column_types={}
>
(byebug) produtos.map{ |p| Produto.new(p) }
[
#<Produto:0x959f908 @id=1, @nome="yuri">,
#<Produto:0x959f8b8 @id=2, @nome="Igor">,
#<Produto:0x959f890 @id=3, @nome="Iran">,
#<Produto:0x959f854 @id=4, @nome="Hotaviano">,
#<Produto:0x959f818 @id=5, @nome="Maria">,
#<Produto:0x959f7b4 @id=6, @nome="José">,
#<Produto:0x959f78c @id=7, @nome="Mateus">,
#<Produto:0x959f764 @id=8, @nome="kaun">
]
(byebug) produtos
#<ActiveRecord::Result:0xa48f6ac
@columns=["id", "nome"],
@rows=[
[1, "yuri"],
[2, "Igor"],
[3, "Iran"],
[4, "Hotaviano"],
[5, "Maria"],
[6, "José"],
[7, "Mateus"],
[8, "kaun"]
],
@hash_rows=[
{"id"=>1, "nome"=>"yuri"},
{"id"=>2, "nome"=>"Igor"},
{"id"=>3, "nome"=>"Iran"},
{"id"=>4, "nome"=>"Hotaviano"},
{"id"=>5, "nome"=>"Maria"},
{"id"=>6, "nome"=>"José"},
{"id"=>7, "nome"=>"Mateus"},
{"id"=>8, "nome"=>"kaun"}
],
@column_types={}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment