update crm

This commit is contained in:
Aung Myo
2017-06-21 10:05:07 +06:30
parent 0e619f3f2a
commit 4ab5c311eb
9 changed files with 63 additions and 12 deletions

View File

@@ -8,6 +8,16 @@ class ApplicationController < ActionController::Base
#this is base api base controller to need to inherit.
#all token authentication must be done here
#response format must be set to JSON
# rescue_from CanCan::AccessDenied do |exception|
# flash[:warning] = exception.message
# redirect_to root_path
# end
def current_user
@current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token]
end
def current_company
begin
return Company.first