On Mon, Jun 21, 2021 at 8:23 AM Steven Peckins <[email protected]> wrote:
> Is it possible to define an association (many_to_one in my case) that uses > a custom join condition? I have a table that has a relationship with > another table based on one column OR another column, not primary keys. > Generating such queries with non-ORM Sequel is easy enough, but so far I > cannot figure out how to define an association like this. I've tried > defining the :dataset option and passing a block to the "many_to_one" > method, but in both cases, Sequel tries to call a non-existent foreign key > method. Can you try to use the :dataset option and also use the key: nil option. If that doesn't work, please post a minimal self contained reproducible example of the problem and I can take a look. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sequel-talk/CADGZSSes19C4o9gTjdwpWmDpcge_2m%3DFjH3PsZmWfoWLTmOywA%40mail.gmail.com.
