end of day commit
This commit is contained in:
@@ -1,10 +1,31 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
|
||||
protect_from_forgery
|
||||
|
||||
private
|
||||
|
||||
def active_list
|
||||
List.find(session[:list_id])
|
||||
def check_active_list_state
|
||||
if session[:active_list_id]
|
||||
unless active_list.active?
|
||||
session[:active_list_id] = nil
|
||||
redirect_to root_path, alert: t('messages.the_list_has_been_closed')
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def active_list
|
||||
return nil unless session[:active_list_id]
|
||||
@active_list ||= List.find(session[:active_list_id])
|
||||
end
|
||||
|
||||
def js_alert(message)
|
||||
{ok: false, message: message}.to_json
|
||||
end
|
||||
def js_notice(message)
|
||||
{ok: true, message: message}.to_json
|
||||
end
|
||||
|
||||
|
||||
helper_method :active_list
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user