Wednesday, November 20, 2013

Re: [Rails] Caching unexpected behaviour

On 20 November 2013 17:40, Paulo Castro <phlcastro@gmail.com> wrote:
> Hi Colin
>
> first of all, thank you very much for your help!! You found the root cause
> of my problem.
>
> After user session expired, the code:
>
> ActiveRecord::Base.establish_connection({:adapter => "mysql", :database =>
> "#{current_user.dbname}", :username => "x", :password => "x", :host => "x",
> :encoding => "utf8"})
>
> didn't work, but also didn't throw any exception.

I expect it returned an error (hence my suggestion to check for error
return). If you look at the docs for establish_connection you will
see that it may throw an exception, but under other circumstances will
return an error.

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%3D0gLsydFpFS%2BGLWveyf9vroY%2BoHf3BYS1%2BE7iMaSn2mBay%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate