Just in case someone comes combing through here, it looks like Rails 3
does things a bit differently and does suggest using the
environment.rb as much.
I created the file "config/initializers/sequel.rb" and it contains:
DB = Sequel.connect(YAML.load(File.read('config/database.yml'))
[Rails.env])
Sequel::Model.plugin :active_model
And... that's it really. Now I just need to figure out how to handle
getting my models to autoload...
On Mar 17, 6:50 pm, cult hero <[email protected]> wrote:
> Excellent! Time to dig in. I haven't touched Rails in a couple years.
>
> Thanks for all the help.
>
> On Mar 17, 6:19 pm, Jeremy Evans <[email protected]> wrote:
>
>
>
> > On Mar 17, 2:02 pm, cult hero <[email protected]> wrote:
>
> > > 1. Does "Sequel::Model.plugin :active_model" load the plugin? (I
> > > haven't actually used any plugins yet!)
>
> > Yes.
>
> > > 2. Do I need to include that code somewhere in the Rails bootstrap
> > > process? (I don't want to have to do it explicitly for all my models.)
>
> > Yes, I do so in environment.rb.
>
> > > 3. When using sequel with Rails, how do I connect to the DB? Doesn't
> > > the databases.yml file only work for AR (or require a special plugin)?
>
> > I do so in each environment file (development.rb, test.rb,
> > production.rb). You can use the database.yml if you want, but you
> > will have to parse the database.yml file yourself.
>
> > Jeremy
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en.