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

Expected User object. Got Array while adding siblings. #19

Open
mukeshsinghr opened this issue Aug 18, 2018 · 1 comment
Open

Expected User object. Got Array while adding siblings. #19

mukeshsinghr opened this issue Aug 18, 2018 · 1 comment

Comments

@mukeshsinghr
Copy link

I am trying to use add_siblings(*siblings) method to add more then one sibling at a time. I am giving array of users and I am getting above error.
user.add_siblings([user1, user2,..])

Whereas If I pass objects comma separated its working fine.
user.add_siblings(user1, user2,..)
As per API document it should work.

For more details Please check the below stacktrace.

["/home/mukesh/.rvm/gems/ruby-2.5.1@go-server/gems/genealogy-2.5.1/lib/genealogy/util_methods.rb:175:incheck_indiv'", "/home/mukesh/.rvm/gems/ruby-2.5.1@go-server/gems/genealogy-2.5.1/lib/genealogy/util_methods.rb:162:in block in check_incompatible_relationship'", "/home/mukesh/.rvm/gems/ruby-2.5.1@go-server/gems/genealogy-2.5.1/lib/genealogy/util_methods.rb:159:in each'", "/home/mukesh/.rvm/gems/ruby-2.5.1@go-server/gems/genealogy-2.5.1/lib/genealogy/util_methods.rb:159:in check_incompatible_relationship'", "/home/mukesh/.rvm/gems/ruby-2.5.1@go-server/gems/genealogy-2.5.1/lib/genealogy/alter_methods.rb:184:in add_siblings'", "/home/mukesh/.rvm/gems/ruby-2.5.1@go-server/gems/genealogy-2.5.1/lib/genealogy/alter_methods.rb:211:in `add_sibling'",

`

@masciugo
Copy link
Owner

you should use comma separated User objects.

So either:
user.add_siblings(*[user1, user2,..])
or
user.add_siblings(user1, user2,..)

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