On 20 November 2013 16:52, Paulo Henrique Leite de Castro 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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
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.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 11 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedNov 20, '13 at 7:11a
activeNov 21, '13 at 9:34a
posts11
users5
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase