On Tue, Nov 21, 2023 at 8:24 AM John Knapp <[email protected]> wrote:

> I cannot find documentation for using models within bin/sequel.
>
> In bin/sequel Users.first gives uninitialized constant error while
> DB[:users].first works as expected. Models in my routes work fine (also,
> as expected.)
>
> I suspect I'm missing a require statement somewhere but as I said, I can't
> find docs.
>
> Is this doable? Is this documented?
>
> If yes but undocumented, I'd happily author the docs and submit a PR.
>

There is no explicit support for model classes built into bin/sequel.
"bin/sequel -L path/to/models/dir" may work, though.

My apps generally use an approach like
https://github.com/jeremyevans/roda-sequel-stack, where I can easily get an
IRB shell with just the Database or the Database and all models just by
requiring ./db or ./models.

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/CADGZSSfki_ntnhiMo1-Z%3DCEun-Fw5xu1OSB-qS99ENcCGgGR4g%40mail.gmail.com.

Reply via email to