can't get ID of created object #35

Open
Nowaker opened this Issue Jan 29, 2012 · 2 comments

Projects

None yet

2 participants

@Nowaker

The code:

lego = Group.seed(:name) do |s|
    s.id = 1
    s.name = 'lego'
    s.max = 2
end

puts '@' + lego.id.to_s

The output:

 - Group {:max=>2, :name=>"lego", :id=>1}
@70059737238420

It's terribly broken because there is a built-in method id in Object class. How to access the ID field?

@Nowaker

Lol, I was able to work-around it with lego[0].id. Please fix it. :)

@chulkilee

#seed method returns array, so that is not a bug actually... But it is confusing to get array when using block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment