Recommended rails setup?

27 views
Skip to first unread message

Pawel Szymczykowski

unread,
Feb 1, 2011, 2:07:47 AM2/1/11
to SimpleRecord
Hi all,

It's been a little while since I've done rails programming and I'm
just getting back into recently with rails 3.0, so this might seem
like a bit of a dumb question.. what's the recommended way to bold
simplerecord onto a rails install?

I've gotten the non-rails standalone version to work just fine. But in
a rails install:

- Do I put SimpleRecord.establish_connection somewhere into
environment.rb? A before_filter?

- I assume it doesn't use database.yml at all?

Just a bit confused about it. In the Rails second of the docs it said
something like 'All you have to do is..' making it seem like I might
not need to call establish_connection after all. Putting it in
environment.rb seems like it might open an SDB connection once at the
start of the app. :/

Thanks for you help!

Travis Reeder

unread,
Feb 1, 2011, 3:37:58 AM2/1/11
to simple...@googlegroups.com
Ya, put it in one of your environment files, if you use different keys for different environments, put them in the separate ones (developer, production, etc), otherwise in application.rb.


--
You received this message because you are subscribed to the Google Groups "SimpleRecord" group.
To post to this group, send email to simple...@googlegroups.com.
To unsubscribe from this group, send email to simple-recor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-record?hl=en.


Pawel Szymczykowski

unread,
Feb 1, 2011, 5:36:40 PM2/1/11
to SimpleRecord
Cool - I'm glad I wasn't too far off. I ended up sticking it into
intializers/simple_record.rb and seems to work like a charm. :)

On Feb 1, 12:37 am, Travis Reeder <tree...@gmail.com> wrote:
> Ya, put it in one of your environment files, if you use different keys for
> different environments, put them in the separate ones (developer,
> production, etc), otherwise in application.rb.
>
> On Mon, Jan 31, 2011 at 11:07 PM, Pawel Szymczykowski <make...@gmail.com>wrote:
>
>
>
>
>
>
>
> > Hi all,
>
> > It's been a little while since I've done rails programming and I'm
> > just getting back into recently with rails 3.0, so this might seem
> > like a bit of a dumb question.. what's the recommended way to bold
> > simplerecord onto a rails install?
>
> > I've gotten the non-rails standalone version to work just fine. But in
> > a rails install:
>
> > - Do I put SimpleRecord.establish_connection somewhere into
> > environment.rb? A before_filter?
>
> > - I assume it doesn't use database.yml at all?
>
> > Just a bit confused about it. In the Rails second of the docs it said
> > something like 'All you have to do is..' making it seem like I might
> > not need to call establish_connection after all. Putting it in
> > environment.rb seems like it might open an SDB connection once at the
> > start of the app. :/
>
> > Thanks for you help!
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "SimpleRecord" group.
> > To post to this group, send email to simple...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > simple-recor...@googlegroups.com<simple-record%2Bunsubscribe@goog legroups.com>
> > .

Dominic

unread,
Feb 1, 2011, 6:56:34 PM2/1/11
to SimpleRecord
if you're using it as a plugin, a reminder to put it at the very end
of environment.rb or else Rails won't see it.
Reply all
Reply to author
Forward
0 new messages