def set_read_only_connection_for_block(action)
      read_pool_method = nil
      if session
        read_pool_method = session[:next_request_db_connection]
        session.delete(:next_request_db_connection) if session[:next_request_db_connection]
      end

      read_pool_method ||= seamless_database_pool_options[action.to_sym] || seamless_database_pool_options[:all]
      if read_pool_method
        SeamlessDatabasePool.set_read_only_connection_type(read_pool_method) do
          yield
        end
      else
        yield
      end
    end
def set_read_only_connection_for_block(action)
      read_pool_method = nil
      if session
        read_pool_method = session[:next_request_db_connection]
        session.delete(:next_request_db_connection) if session[:next_request_db_connection]
      end

      read_pool_method ||= seamless_database_pool_options[action.to_sym] || seamless_database_pool_options[:all]
      if read_pool_method
        SeamlessDatabasePool.set_read_only_connection_type(read_pool_method) do
          yield
        end
      else
        yield
      end
    end
Set the read only connection for a block. Used to set the connection for a controller action.