Sha256: 3ea7562b2344752a8e25420f87456a0d8572cc6c9e157aca46a2c19744c2e075
Contents?: true
Size: 590 Bytes
Versions: 15
Compression:
Stored size: 590 Bytes
Contents
module TkhAuthenticationHelper def self.included(base) base.send(:include, InstanceMethods) # base.before_filter :current_user # base.after_filter :my_method_2 end module InstanceMethods # duplicated from action controller extension. there must be a better way def current_user @current_user ||= User.find_by!(auth_token: cookies[:auth_token]) if cookies[:auth_token] end # duplicated from action controller extension. there must be a better way def administrator? @administrator ||= current_user && current_user.admin? end end end
Version data entries
15 entries across 15 versions & 1 rubygems