Class: EricWeixin::Cms::BaseController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/eric_weixin/cms/base_controller.rb

Instance Method Summary collapse

Instance Method Details

#current_userObject



9
10
11
12
# File 'app/controllers/eric_weixin/cms/base_controller.rb', line 9

def current_user
  return nil if session[:employee_id].blank?
  ::Personal::Employee.find(session[:employee_id])
end

#need_loginObject



14
15
16
17
# File 'app/controllers/eric_weixin/cms/base_controller.rb', line 14

def 
  redirect_to '/cms' if current_user.blank?
  return
end

#roundObject



5
6
7
# File 'app/controllers/eric_weixin/cms/base_controller.rb', line 5

def round
  yield
end