Sha256: 0c11e2e211e0ce82e5bda1931183b54e44b9f3e5eaf1f9911351056c13a476ba
Contents?: true
Size: 558 Bytes
Versions: 47
Compression:
Stored size: 558 Bytes
Contents
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 def prepare_filters fc_struct = Struct.new(:orders,:departments,:users) @filter_collections = fc_struct.new(::Order.all, ::Department.all, ::User.all) end def current_user @current_user ||= ::User.where(id: params[:current_user_id]).first || ::User.where("id is not null").first @current_user end helper_method :current_user end
Version data entries
47 entries across 47 versions & 1 rubygems