Skip to content

Commit 1db4e36

Browse files
committed
refac: Align controller names with Ditty naming conventions
1 parent 5f29d35 commit 1db4e36

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

lib/ditty/components/proxes.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ def self.public_folder
2727
def self.routes
2828
load
2929
{
30-
'/search' => ::ProxES::Search,
31-
'/status' => ::ProxES::Status,
32-
'/status-checks' => ::ProxES::StatusChecks,
33-
'/permissions' => ::ProxES::Permissions
30+
'/search' => ::ProxES::SearchController,
31+
'/status' => ::ProxES::StatusController,
32+
'/status-checks' => ::ProxES::StatusChecksController,
33+
'/permissions' => ::ProxES::PermissionsController
3434
}
3535
end
3636

3737
def self.navigation
3838
load
3939
[
40-
{ order: 0, link: '/status/check', text: 'Status Check', target: ::ProxES::Status, icon: 'dashboard' },
40+
{ order: 0, link: '/status/check', text: 'Status Check', target: ::ProxES::StatusController, icon: 'dashboard' },
4141
{ order: 1, link: '/status-checks', text: 'Mange Status Checks', target: ::ProxES::StatusCheck, icon: 'dashboard' },
42-
{ order: 1, link: '/search', text: 'Search', target: ::ProxES::Search, icon: 'search' },
42+
{ order: 1, link: '/search', text: 'Search', target: ::ProxES::SearchController, icon: 'search' },
4343
{ order: 15, link: '/permissions', text: 'Permissions', target: ::ProxES::Permission, icon: 'check-square' }
4444
]
4545
end

lib/proxes/controllers/permissions.rb renamed to lib/proxes/controllers/permissions_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
require 'proxes/policies/permission_policy'
88

99
module ProxES
10-
class Permissions < Ditty::ComponentController
10+
class PermissionsController < Ditty::ComponentController
1111
set model_class: Permission
1212
set view_folder: ::Ditty::ProxES.view_folder
1313

lib/proxes/controllers/search.rb renamed to lib/proxes/controllers/search_controller.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
require 'proxes/policies/search_policy'
77

88
module ProxES
9-
class Search < Ditty::ApplicationController
9+
class SearchController < Ditty::ApplicationController
1010
set base_path: "#{settings.map_path}/search"
1111
set view_folder: ::Ditty::ProxES.view_folder
12+
set view_location: 'search'
13+
14+
def self.policy_class
15+
ProxES::SearchPolicy
16+
end
1217

1318
def search_service
1419
ProxES::Services::Search.new(user: current_user)

lib/proxes/controllers/status_checks.rb renamed to lib/proxes/controllers/status_checks_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
require 'proxes/models/status_check'
66

77
module ProxES
8-
class StatusChecks < Ditty::ComponentController
8+
class StatusChecksController < Ditty::ComponentController
99
set model_class: StatusCheck
1010
set view_folder: ::Ditty::ProxES.view_folder
1111

lib/proxes/controllers/status.rb renamed to lib/proxes/controllers/status_controller.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66
require 'proxes/services/es'
77

88
module ProxES
9-
class Status < Ditty::ApplicationController
9+
class StatusController < Ditty::ApplicationController
1010
set view_folder: ::Ditty::ProxES.view_folder
1111

1212
include ProxES::Services::ES
1313

14+
def self.policy_class
15+
ProxES::StatusPolicy
16+
end
17+
1418
# This provides a URL that can be polled by a monitoring system. It will return
1519
# 200 OK if all the checks pass, or 500 if any of the checks fail.
1620
get '/check' do

0 commit comments

Comments
 (0)