2017-04-10 22:27:03 +03:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Admin
|
|
|
|
class BaseController < ApplicationController
|
2017-11-11 21:23:33 +02:00
|
|
|
include Authorization
|
2017-11-24 03:05:53 +02:00
|
|
|
include AccountableConcern
|
2017-11-11 21:23:33 +02:00
|
|
|
|
2018-10-25 01:10:01 +03:00
|
|
|
layout 'admin'
|
|
|
|
|
|
|
|
before_action :set_body_classes
|
2022-07-05 03:41:40 +03:00
|
|
|
after_action :verify_authorized
|
2017-04-10 22:27:03 +03:00
|
|
|
|
2018-10-25 01:10:01 +03:00
|
|
|
private
|
|
|
|
|
|
|
|
def set_body_classes
|
|
|
|
@body_classes = 'admin'
|
|
|
|
end
|
2018-12-17 12:40:51 +02:00
|
|
|
|
|
|
|
def set_user
|
|
|
|
@user = Account.find(params[:account_id]).user || raise(ActiveRecord::RecordNotFound)
|
|
|
|
end
|
2017-04-10 22:27:03 +03:00
|
|
|
end
|
|
|
|
end
|