Hello,

  Previously I've had a helper assert_no_database like this:

  def assert_no_database
    old_con = ActiveRecord::Base.remove_connection
    begin
      yield
    ensure
      ActiveRecord::Base.establish_connection old_con
    end
  end

  But it doesn't work in Rails 3.1.1 anymore (due to the following change:
https://github.com/rails/rails/issues/2820)

  Any suggestion for a proper way to check that a block of code doesn't
access database?

  Thanks,
  KIR

-- 

Kirill (KIR) Maximov

Software Engineer & Starter


Twitter:       http://twitter.com/maxkir

Skype:        maxkir

http://kirblog.idetalk.com | http://checkvist.com |
http://www.jetbrains.com/teamcity

-- 
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