app/controllers/application_controller.rb
# The guest_user setup will, on-demand, create a temporary 'guest'
# user in the db to represent a not-yet-logged-in user, so they can
# still save bookmarks and such for their session.
#
# The particular semantics and methods we implement are those neccesary
# for compatibility wtih Blacklight, see https://github.com/projectblacklight/blacklight/wiki/Blacklight-3.7-release-notes-and-upgrade-guide
# needs #guest_user and  #current_or_guest_user
The guest_user setup will, on-demand, create a temporary 'guest'
user in the db to represent a not-yet-logged-in user, so they can
still save bookmarks and such for their session.


The guest_user setup will on - demand create a temporary ' guest ' user in the db to represent a not - yet - logged - in user so they can still save bookmarks and such for their session .
def guest_user
    unless defined? @guest_user
      if session[:guest_user_id] && (user = User.where(:id => session[:guest_user_id]).first)
        @guest_user = user
      else
        @guest_user = create_guest_user!
        session[:guest_user_id] = @guest_user.id
      end
    end
    return @guest_user
  end
def guest_user unless defined? @guest_user if session [ :guest_user_id ] && ( user = User . where ( :id => session [ :guest_user_id ] ) . first ) @guest_user = user else @guest_user = create_guest_user! session [ :guest_user_id ] = @guest_user . id end end return @guest_user end
The guest_user setup will, on-demand, create a temporary 'guest'
user in the db to represent a not-yet-logged-in user, so they can
still save bookmarks and such for their session.
The guest_user setup will on - demand create a temporary ' guest ' user in the db to represent a not - yet - logged - in user so they can still save bookmarks and such for their session .