On Oct 16, 2011, at 8:35 AM, KIR wrote:

>  ActiveRecord::Base.establish_connection Rails.env
> 
>    I don't quite understand what do you mean here?

I know what your problem is. If because of changes to Rails reconnecting to the 
db by using the old connection doesn't work, then I suggested that you give up 
on using the old connection and just instruct AR to connect as if the 
application was just booting up. Have you tried what I suggested at all? Are 
you having the same problem?

  def without_database_connection
    ActiveRecord::Base.remove_connection
    begin
      yield
    ensure
      ActiveRecord::Base.establish_connection Rails.env
    end
  end

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to