app/controllers/application_controller.rb
# Creates a mock user in the db to represent a 'guest' not yet logged in,
# to make Blacklight bookmarks still work with not yet logged in people.
Creates a mock user in the db to represent a 'guest' not yet logged in,
to make Blacklight bookmarks still work with not yet logged in people.
Creates a mock user in the db to represent a ' guest ' not yet logged in to make Blacklight bookmarks still work with not yet logged in people .
def create_guest_user!
    unique_token = "#{request.session_options[:id]}_#{(Time.now.to_f * 1000.0).to_i}_#{Process.pid}"
    new_user = User.new.tap do |u|
      u.login = "GUEST_USER_#{unique_token}"
      u.guest = true
      u.save!
    end
  end
def create_guest_user! unique_token = "#{request.session_options[:id]}_#{(Time.now.to_f * 1000.0).to_i}_#{Process.pid}" new_user = User . new . tap do | u | u . login = "GUEST_USER_#{unique_token}" u . guest = true u . save! end end
Creates a mock user in the db to represent a 'guest' not yet logged in,
to make Blacklight bookmarks still work with not yet logged in people.
Creates a mock user in the db to represent a ' guest ' not yet logged in to make Blacklight bookmarks still work with not yet logged in people .
# bah, this may not be entirely guaranteed to be unique # but it would be hard for it to collide, good enough. Actually # if the rails session id isn't unique, it's gonna cause problems # for more than just us, we should be good with just that even.