masciugo / genealogy

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

spouses method is not considering the current spouse #20

Open mukeshsinghr opened 6 years ago

mukeshsinghr commented 6 years ago

Currently spouses method is just checking if there is any children with the spouse or not. In case no children then its omitting the spouse.

Say for eg. User has added current spouse but has no children yet. When he checks spouses method it returns no result. If user checks using current_spouse method then it shows a result.

I believe we should consider current_spouse as well for spouses.

Ref: https://github.com/masciugo/genealogy/blob/master/lib/genealogy/query_methods.rb#L63

masciugo commented 6 years ago

I'll add that in the next release. thank you