GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
On my quest to make ancestry play nice with string primary keys I have stumbled upon another problem. The method 'ancestor_ids' assumes that it has to cast ids to integers. With string keys this goes wrong.
So here is a patch that will actually make the plugin inspect the model to see how it should cast. Only string columns are handled, everything else is treated as an integer. I suppose support for other kinds of columns could be added, but I'm not sure any other kind of primary key makes sense.
A test has been added to make sure ancestor ids are correct for string columns.
Automatically determine primary key column type, and cast to integer …
…only if primary key is an int.
seems to solve my problem in https://github.com/stefankroes/ancestry/issues#issue/30
Finally someone who pays attention to uuids. Just dropped the evaluation of all other tree gems/plugins due to this