13 lines
222 B
Ruby
13 lines
222 B
Ruby
module Authenticatable
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
before_action :authenticate_user
|
|
end
|
|
|
|
private
|
|
|
|
def authenticate_user
|
|
Current.user = User.find_by(id: session[:current_user_id])
|
|
end
|
|
end
|