On 20 November 2013 16:52, Paulo Henrique Leite de Castro <[email protected]> wrote: > Hi Fred, thanks for your reply! > > I'm using authlogic gem to authenticate my users. > > Inside my Application Controller I created the following code: > > prepend_before_filter :database_connection > > and this method has the following code: > > ActiveRecord::Base.establish_connection({:adapter => "mysql", :database => > "#{current_user.dbname}", :username => "x", :password => "x", :host => "x", > :encoding => "utf8"})
Are you checking for an error return here in case it fails for some reason, leaving the connection as it was for the last request? Also I presume you are not silently absorbing any exception raised there. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsF6m4v-T2XHj72Cm6AV7_ey_woiNDg0m%2B7t6ReMwRs%3Dw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.

