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

Don't break on models where primary_key is not defined #168

Merged
merged 1 commit into from Sep 5, 2023

Conversation

ghiculescu
Copy link
Member

#163 introduced these errors into Rails CI: https://buildkite.com/rails/rails/builds/99322#018a5d7e-f556-4966-a32d-904737c65eeb

They are occuring on classes that include GlobalID::Identification but are not Active Record subclasses.

There is no explicit GlobalID API identified, but as far as I can tell, the only methods you need to implement are self.find, self.where, and id. So this PR ensures that we don't break support for classes that don't implement primary_key.

Copy link
Contributor

@adrianna-chang-shopify adrianna-chang-shopify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ghiculescu , this definitely seems like a fairer compromise 🙇‍♀️

cc @rafaelfranca @eileencodes

@eileencodes eileencodes merged commit 626a342 into rails:main Sep 5, 2023
17 checks passed
@ghiculescu ghiculescu deleted the handle-no-primary-key branch September 5, 2023 21:32
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

Successfully merging this pull request may close these issues.

None yet

3 participants