-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Repository::find doesn't seem to work with composite keys #432
Comments
ROM can deal with composite keys but it seems that |
If ROM can deal with it, would changing model/lib/hanami/repository.rb Line 411 in ff2dae4
to root.by_pk(*id).as(:entity).one suffice (source)? It would than be called repository.find([name, version]) or repository.find(name, version) I would prefer the first one imho. But supporting syntax like repository.find({ name: n, version: v }) would be best but no longer one-line change; I'm sure it can be implemented however I have no idea where to start. |
@mereghost what do you think? can you implement this? |
Working on this. |
@AlfonsoUceda are you still working on it? If not, may I try to take this over? |
@MichalJaneda they removed their assignment so you're probably safe to work on it, |
Hey @MichalJaneda yes you can work on that, but better confirm with @jodosha if it worths it |
Assuming I have table containing composite primary key
I didn't find a way to retrieve such record using
Repository.new.find
. Tried thisbut got
Is there a way to retrieve it? Don't seem like it based on source code (afaict)... So how am I supposed to use composite keys? Thanks :)
The text was updated successfully, but these errors were encountered: