A thousand thank you's Jeremy!

The solution is right there in the bin/sequel docs 
<https://sequel.jeremyevans.net/rdoc/files/doc/bin_sequel_rdoc.html>:
> -L loads all *.rb files under the given directory. *This is usually used 
to load Sequel::Model classes into bin/sequel*.

Just what I was after!

Thanks again and thank you for your invaluable contributions to the OSS 
landscape!

Regards,
John
On Tuesday, November 21, 2023 at 8:33:48 AM UTC-8 Jeremy Evans wrote:

> 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/6afe140a-7ed7-4ce7-b26a-49e9aee89264n%40googlegroups.com.

Reply via email to