Hi all,

is it possible to select the database after the user login?
I need something like this:
1. Login screen where the user types in his username and password
2. Searching for the username in two databases (which have the same
structure)
3. if username is found in on of the two databases, select this database
for the whole session

I hope you understand what I mean.

Thanks for your responds!

--
Posted via http://www.ruby-forum.com/.

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • BirdieTracker at Dec 18, 2011 at 11:39 pm
    You may be able to set up an abstract model with two child models in
    which each child uses a different database. One way to connect to
    different databases is by using the USE_DB gem. Once your user is
    logged in, you can set something in their session then somehow direct
    them to one database or the other by changing the value of the use_db
    call in the model.

    Can I ask why you have two identically structured databases with
    different data for login? I'm interested in learning about the use
    case.



    On Dec 18, 1:53 pm, Rike Hase wrote:
    Hi all,

    is it possible to select the database after the user login?
    I need something like this:
    1. Login screen where the user types in his username and password
    2. Searching for the username in two databases (which have the same
    structure)
    3. if username is found in on of the two databases, select this database
    for the whole session

    I hope you understand what I mean.

    Thanks for your responds!

    --
    Posted viahttp://www.ruby-forum.com/.
    --
    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@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Dheeraj Kumar at Dec 19, 2011 at 2:05 am
    I'm thinking it might be a multi tenant, but with the same initial UI. That's one possible use case.


    Dheeraj Kumar

    On Monday 19 December 2011 at 5:09 AM, BirdieTracker wrote:

    You may be able to set up an abstract model with two child models in
    which each child uses a different database. One way to connect to
    different databases is by using the USE_DB gem. Once your user is
    logged in, you can set something in their session then somehow direct
    them to one database or the other by changing the value of the use_db
    call in the model.

    Can I ask why you have two identically structured databases with
    different data for login? I'm interested in learning about the use
    case.



    On Dec 18, 1:53 pm, Rike Hase (http://ruby-forum.com)> wrote:
    Hi all,

    is it possible to select the database after the user login?
    I need something like this:
    1. Login screen where the user types in his username and password
    2. Searching for the username in two databases (which have the same
    structure)
    3. if username is found in on of the two databases, select this database
    for the whole session

    I hope you understand what I mean.

    Thanks for your responds!

    --
    Posted viahttp://www.ruby-forum.com/.

    --
    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@googlegroups.com (mailto:rubyonrails-talk@googlegroups.com).
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com (mailto:rubyonrails-talk+unsubscribe@googlegroups.com).
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

    --
    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@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedDec 18, '11 at 7:53p
activeDec 19, '11 at 2:05a
posts3
users3
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase