Forum: Ruby on Rails Getting Username, Password and DB Being Presently Used

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ba79eb31ceaef95e9e52f5e5e4ec6d02?d=identicon&s=25 John Kopanas (Guest)
on 2007-05-28 19:39
(Received via mailing list)
What is the easiest way to get the present username, password and db
name being used?  Is this info being stored in an object?

I want the information to run a mysql command to export data onto
server using system("')

Thanks :-)

--
John Kopanas
john@kopanas.com

http://www.kopanas.com
http://www.cusec.net
http://www.soen.info
Fc49ff6d82732b73a94be2974b4dd3df?d=identicon&s=25 Gabriel Gironda (Guest)
on 2007-05-28 20:17
(Received via mailing list)
ActiveRecord::Base.configurations will return a hash that has the
information you need. ActiveRecord::Base.configurations['test'], for
example, will return the DB settings for your test environment.

- Gabriel
Fc49ff6d82732b73a94be2974b4dd3df?d=identicon&s=25 Gabriel Gironda (Guest)
on 2007-09-25 23:04
(Received via mailing list)
The constant RAILS_ENV has the current environment.

- Gabriel
Ba79eb31ceaef95e9e52f5e5e4ec6d02?d=identicon&s=25 John Kopanas (Guest)
on 2007-09-25 23:04
(Received via mailing list)
ahhh... very cool... now how do I know which environment I am in? :-)

On 5/28/07, John Kopanas <john@kopanas.com> wrote:
> > On 5/28/07, John Kopanas <kopanas@gmail.com> wrote:
> > > John Kopanas
> >
>
>
> --
> John Kopanas
> john@kopanas.com
>
> http://www.kopanas.com
> http://www.cusec.net
> http://www.soen.info
>


--
John Kopanas
john@kopanas.com

http://www.kopanas.com
http://www.cusec.net
http://www.soen.info
This topic is locked and can not be replied to.