On 3/3/07, snacktime <snacktime-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I''ve seen a number of ways to use AR outside of rails, and am
> wondering what other think is the best approach for my particular
> application.
>
> The application is in it''s own module namespace. To use it within
> rails you just require it in application.rb and instantiate a class to
> call methods on. It''s also well suited to be used from other
various
> applications though. The simplest way I could think of to make my
> application work inside and outside of rails without much user
> intervention would be something like this.
>
> require ''activerecord''
> if ENV and ENV.has_key?(''RAILS_ENV'')
> require ''models/mymodel''
> ActiveRecord::Base.establish_connection()
> end
>
> I''d probably use a yaml file to store the database configuration
like
> rails does.
>
> Any better ideas?
>
Argh that should have been:
unless ENV and ENV.has_key?(''RAILS_ENV'')
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---