Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't get ID of created object #35

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

can't get ID of created object #35

Nowaker opened this issue Jan 29, 2012 · 2 comments

Comments

@Nowaker
Copy link

Nowaker commented Jan 29, 2012

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
Copy link
Author

Nowaker commented Jan 29, 2012

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

@chulkilee
Copy link

#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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants