Hi, I was wondering if anyone is familiar with restful_authentication plugin. I have an app which uses restful_authentication and I am creating a new app which will exist at a seperate url. However, I would like users who have registered on app1 to be able to log into app2 without having to register again. For new members I am going to use establish_connection to save the user to 2 databases. But for existing members I have tried importing the existing columns from the user database in app1 (encrypted_password, salt etc.) to the user database in app2 which has the same columns, but the log in does not work. Can anyone suggest why this may be? Thanks, Dan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Why not use the user table in the old DB for everything instead of duplicating the information in both tables? On Apr 21, 10:01 am, DanC <d.m.coleg...-VlwAjOFxKoqFxr2TtlUqVg@public.gmane.org> wrote:> Hi, > > I was wondering if anyone is familiar with restful_authentication > plugin. > > I have an app which uses restful_authentication and I am creating a > new app which will exist at a seperate url. However, I would like > users who have registered on app1 to be able to log into app2 without > having to register again. > > For new members I am going to use establish_connection to save the > user to 2 databases. > > But for existing members I have tried importing the existing columns > from the user database in app1 (encrypted_password, salt etc.) to the > user database in app2 which has the same columns, but the log in does > not work. > > Can anyone suggest why this may be? > > Thanks, > > Dan > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
HI Sharagoz, How would I do this? At a guess, I could probably use establish_connection (point to app1 DB) in the User.rb and Permission.rb model files of app2 Is there another way? Thanks for the quick response, Dan On 21 Apr, 09:05, Sharagoz <shara...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Why not use the user table in the old DB for everything instead of > duplicating the information in both tables? > > On Apr 21, 10:01 am, DanC <d.m.coleg...-VlwAjOFxKoqFxr2TtlUqVg@public.gmane.org> wrote: > > > > > > > Hi, > > > I was wondering if anyone is familiar with restful_authentication > > plugin. > > > I have an app which uses restful_authentication and I am creating a > > new app which will exist at a seperate url. However, I would like > > users who have registered on app1 to be able to log into app2 without > > having to register again. > > > For new members I am going to use establish_connection to save the > > user to 2 databases. > > > But for existing members I have tried importing the existing columns > > from the user database in app1 (encrypted_password, salt etc.) to the > > user database in app2 which has the same columns, but the log in does > > not work. > > > Can anyone suggest why this may be? > > > Thanks, > > > Dan > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
Add a new DB connection in database.yml other_db_development: adapter: mysql database: other_db_development (etc) Then in User.rb make it use that connection like so: class User < ActiveRecord::Base establish_connection(:other_db_development) end Every CRUD operation on the User model will now go to that database Nothing needs to be changed in the code of the other application, as the request goes directly to the database. On Apr 21, 10:10 am, DanC <d.m.coleg...-VlwAjOFxKoqFxr2TtlUqVg@public.gmane.org> wrote:> HI Sharagoz, > > How would I do this? > > At a guess, I could probably use establish_connection (point to app1 > DB) in the User.rb and Permission.rb model files of app2 > > Is there another way? > > Thanks for the quick response, > > Dan > > On 21 Apr, 09:05, Sharagoz <shara...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Why not use the user table in the old DB for everything instead of > > duplicating the information in both tables? > > > On Apr 21, 10:01 am, DanC <d.m.coleg...-VlwAjOFxKoqFxr2TtlUqVg@public.gmane.org> wrote: > > > > Hi, > > > > I was wondering if anyone is familiar with restful_authentication > > > plugin. > > > > I have an app which uses restful_authentication and I am creating a > > > new app which will exist at a seperate url. However, I would like > > > users who have registered on app1 to be able to log into app2 without > > > having to register again. > > > > For new members I am going to use establish_connection to save the > > > user to 2 databases. > > > > But for existing members I have tried importing the existing columns > > > from the user database in app1 (encrypted_password, salt etc.) to the > > > user database in app2 which has the same columns, but the log in does > > > not work. > > > > Can anyone suggest why this may be? > > > > Thanks, > > > > Dan > > > > -- > > > 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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. > > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > For more options, visit this group athttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.