masciugo / genealogy

Make ActiveRecord model act as a pedigree
MIT License
30 stars 17 forks source link

Unable to add child in latest version 2.0.2 #9

Closed namanipradeepkumar closed 9 years ago

namanipradeepkumar commented 9 years ago

Hi,

I am the fan of genealogy. It saved a lot of my valuable time. I have used 1.5.0 till now. My Application was worked very well when i was in 1.5.0 version.

After updating to gem to latest version ( 2.0.2 ), i am not able to adding a child to user. It is throwing an exception called "User1 Can't be father of User2".

Please resolve the issue and let me know.

Thank you!

screenshot from 2015-03-19 12 36 40

masciugo commented 9 years ago

hi,

please provide the exact error backtrace. I see different exception in your snapshot... Consider also that genealogy 2 is a major upgrade and can have backward incompatibilities. In this case it seem an ineligibility related problem. In genealogy 2 ineligibility checks are enabled by default at pedigree level. Turn it off with has_parents ineligibility: false. I've just got aware now that there is a typo in the doc about this: it wrongly says ineligibility: :off... i'm going to correct it

namanipradeepkumar commented 9 years ago

Sorry, i attached wrong screenshot. Now i edited question with correct screenshot.

With your suggestion, i kept has_parents ineligibility: false in the model. Now it is working fine.

Why should i disable ineligibility? Is there any wrong in my relation? I just want to add child for the current user.

What is wrong in that?

Thank you!

masciugo commented 9 years ago

Ineligibility is not an easy feature and, most likely, perfectible. I'm working on that. To answer your question first of all re-enable ineligibility and run current_user.ineligible_children. Is your child included in the list? If so have a look here and tell me, please, if it make sense to you...

masciugo commented 9 years ago

@namanipradeepkumar any feedback?