Open graywolf opened 7 years ago
ROM can deal with composite keys but it seems that hanami-model
can't deal with them right now.
If ROM can deal with it, would changing
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 :)