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-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org http://www.kopanas.com http://www.cusec.net http://www.soen.info --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Gabriel Gironda
2007-May-28 18:09 UTC
Re: Getting Username, Password and DB Being Presently Used
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 On 5/28/07, John Kopanas <kopanas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org > > http://www.kopanas.com > http://www.cusec.net > http://www.soen.info > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
John Kopanas
2007-May-28 19:22 UTC
Re: Getting Username, Password and DB Being Presently Used
ahhh... very cool... now how do I know which environment I am in? :-) On 5/28/07, John Kopanas <john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org> wrote:> ahhh... very cool... now how do I know which environment I am in? :-) > > On 5/28/07, Gabriel Gironda <gabriel.gironda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > 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 > > > > On 5/28/07, John Kopanas <kopanas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > 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-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org > > > > > > http://www.kopanas.com > > > http://www.cusec.net > > > http://www.soen.info > > > > > > > > > > > > > > > > > > > > > -- > John Kopanas > john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org > > http://www.kopanas.com > http://www.cusec.net > http://www.soen.info >-- John Kopanas john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org http://www.kopanas.com http://www.cusec.net http://www.soen.info --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Gabriel Gironda
2007-May-28 23:06 UTC
Re: Getting Username, Password and DB Being Presently Used
The constant RAILS_ENV has the current environment. - Gabriel On 5/28/07, John Kopanas <kopanas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > ahhh... very cool... now how do I know which environment I am in? :-) > > On 5/28/07, John Kopanas <john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org> wrote: > > ahhh... very cool... now how do I know which environment I am in? :-) > > > > On 5/28/07, Gabriel Gironda <gabriel.gironda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > 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 > > > > > > On 5/28/07, John Kopanas <kopanas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > 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-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org > > > > > > > > http://www.kopanas.com > > > > http://www.cusec.net > > > > http://www.soen.info > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > John Kopanas > > john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org > > > > http://www.kopanas.com > > http://www.cusec.net > > http://www.soen.info > > > > > -- > John Kopanas > john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org > > http://www.kopanas.com > http://www.cusec.net > http://www.soen.info > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---