debshots/app/controllers/application_controller.rb

20 lines
661 B
Ruby

class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
# Do not mention passwords in the log file
# filter_parameter_logging :password
before_action :get_current_users_screenshots
# Query for packages that were uploaded by the current user.
# As AAA is not yet implemented it means looking for uploads
# that correspond to the user's cookie token.
def get_current_users_screenshots
if session[:token]
@current_users_screenshots = Screenshot.uploaded_by(session[:token])
end
end
end