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.
John K. (Guest)
on 2007-05-28 21: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 K.
removed_email_address@domain.invalid

http://www.kopanas.com
http://www.cusec.net
http://www.soen.info
Gabriel Gironda (Guest)
on 2007-05-28 22: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
Gabriel Gironda (Guest)
on 2007-09-26 01:04
(Received via mailing list)
The constant RAILS_ENV has the current environment.

- Gabriel
John K. (Guest)
on 2007-09-26 01:04
(Received via mailing list)
ahhh... very cool... now how do I know which environment I am in? :-)

On 5/28/07, John K. <removed_email_address@domain.invalid> wrote:
> > On 5/28/07, John K. <removed_email_address@domain.invalid> wrote:
> > > John K.
> >
>
>
> --
> John K.
> removed_email_address@domain.invalid
>
> http://www.kopanas.com
> http://www.cusec.net
> http://www.soen.info
>


--
John K.
removed_email_address@domain.invalid

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