test/app/controllers/importer_controller.rb
# Returns the id for the given user or raises RecordNotFound
# Implements a cache of users based on login name
Returns the id for the given user or raises RecordNotFound
Implements a cache of users based on login name
Returns the id for the given user or raises RecordNotFound Implements a cache of users based on login name
def user_for_login!(login)
    begin
      if !@user_by_login.has_key?(login)
        @user_by_login[login] = User.find_by_login!(login)
      end
    rescue ActiveRecord::RecordNotFound
      if params[:use_anonymous]
        @user_by_login[login] = User.anonymous()
      else
        @unfound_class = "User"
        @unfound_key = login
        raise
      end
    end
    @user_by_login[login]
  end
def user_for_login! ( login ) begin if ! @user_by_login . has_key? ( login ) @user_by_login [ login ] = User . find_by_login! ( login ) end rescue ActiveRecord :: RecordNotFound if params [ :use_anonymous ] @user_by_login [ login ] = User . anonymous ( ) else @unfound_class = "User" @unfound_key = login raise end end @user_by_login [ login ] end
Returns the id for the given user or raises RecordNotFound
Implements a cache of users based on login name
Returns the id for the given user or raises RecordNotFound Implements a cache of users based on login name
login
<not_specific>