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

Limiting ActiveRecord::Relation Finder to uuidable models #1

Closed
dshimy opened this issue May 30, 2019 · 2 comments
Closed

Limiting ActiveRecord::Relation Finder to uuidable models #1

dshimy opened this issue May 30, 2019 · 2 comments

Comments

@dshimy
Copy link

dshimy commented May 30, 2019

Is it possible to limit overriding the find(*args) method in the ActiveRecord::Relation to uuidable models?

My use case is I want to force the use of UUIDs when searching for a model. As an alternative, a new finder method can be created, however, I was looking to avoid that.

Thanks.

@prsanjay
Copy link

prsanjay commented Mar 3, 2021

Would not it work if you define self.primary_key = uuid in model file?

@dshimy
Copy link
Author

dshimy commented Mar 30, 2021

Thank you for the reply. I no longer use this library and am not able to test the suggestion. Will close.

@dshimy dshimy closed this as completed Mar 30, 2021
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