Skip to content

Commit 9d7e902

Browse files
committed
Move route_uncountable? back to the Resource class as it's overwritten
by PageResources
1 parent f98cb4c commit 9d7e902

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/active_admin/resource/routes.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ def route_prefix
2020
namespace.module_name.try(:underscore)
2121
end
2222

23+
def route_uncountable?
24+
config = controller.resources_configuration[:self]
25+
26+
config[:route_collection_name] == config[:route_instance_name]
27+
end
28+
2329
private
2430

2531
class RouteBuilder
@@ -30,7 +36,7 @@ def initialize(resource)
3036
def collection_path(params)
3137
route_name = route_name(
3238
resource.controller.resources_configuration[:self][:route_collection_name],
33-
(route_uncountable? ? 'index_path' : 'path')
39+
(resource.route_uncountable? ? 'index_path' : 'path')
3440
)
3541

3642
routes.send(route_name, *route_collection_params(params))
@@ -84,12 +90,6 @@ def belongs_to_name
8490
resource.belongs_to_config.target.resource_name.singular if nested?
8591
end
8692

87-
def route_uncountable?
88-
config = resource.controller.resources_configuration[:self]
89-
90-
config[:route_collection_name] == config[:route_instance_name]
91-
end
92-
9393
def routes
9494
Rails.application.routes.url_helpers
9595
end

0 commit comments

Comments
 (0)