Sequel ships with a many_through_many plugin that allows for querying between models through multiple join tables:
Notebook.plugin :many_through_many
Notebook.many_through_many :facts,
:through=>[
[:notebooks_notes, :notebook_id, :note_id],
[:notes, :id, :id],
[:facts_notes, :note_id, :fact_id]
]
n = Notebook.first
n.facts