2017-12-28 19:44:11 +01:00
|
|
|
module Manager
|
|
|
|
class ApplicationController < Administrate::ApplicationController
|
|
|
|
before_action :authenticate_administration!
|
|
|
|
before_action :default_params
|
|
|
|
|
|
|
|
def default_params
|
2018-11-06 18:32:35 +01:00
|
|
|
params[resource_name] ||= {
|
|
|
|
order: "created_at",
|
|
|
|
direction: "desc"
|
|
|
|
}
|
2017-12-28 19:44:11 +01:00
|
|
|
end
|
2018-01-17 12:13:26 +01:00
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
def authenticate_administration!
|
|
|
|
if administration_signed_in?
|
|
|
|
super
|
|
|
|
else
|
|
|
|
redirect_to manager_sign_in_path
|
|
|
|
end
|
|
|
|
end
|
2017-12-28 19:44:11 +01:00
|
|
|
end
|
|
|
|
end
|