blob: 94859d19984573bca608d7668bd2112d3b8293ca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
class ApplicationController < ActionController::Base
before_action :authenticate_user!
before_action :redirect_if_no_active_character, unless: :devise_controller?
helper_method :current_char
def current_char
@_current_char ||= current_user&.active_character
end
def redirect_if_no_active_character
redirect_to new_character_path if (current_user && current_char.nil?)
end
def roll(sides)
rand(sides) + 1
end
end
|