environment.rb
# this probably isn't threadsafe?
# but then migrations probably it doesn't matter?
this probably isn't threadsafe.
this probably isn ' t threadsafe .
def with_connection(&block)
          old_connection = ActiveRecord::Base.connected? && ActiveRecord::Base.connection.instance_variable_get(:"@config")
          ::ActiveRecord::Base.establish_connection Weed::ActiveRecord::Base.connection_args
          yield
        ensure
          if old_connection
            ::ActiveRecord::Base.establish_connection old_connection
          else
            ::ActiveRecord::Base.remove_connection
          end
        end
def with_connection ( & block ) old_connection = ActiveRecord :: Base . connected? && ActiveRecord :: Base . connection . instance_variable_get ( :" @config " ) :: ActiveRecord :: Base . establish_connection Weed :: ActiveRecord :: Base . connection_args yield ensure if old_connection :: ActiveRecord :: Base . establish_connection old_connection else :: ActiveRecord :: Base . remove_connection end end
this probably isn't threadsafe?
this probably isn ' t threadsafe?
block
<not_specific>