parliament-routes 0.6.25 → 0.6.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/lib/ext/action_dispatch/routing/mapper.rb +1 -0
- data/config/routes.rb +15 -3
- data/lib/parliament/engine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89c922f98b164f4628b0b4b71522b6dc157a5c1a
|
4
|
+
data.tar.gz: e10e882d4765eb2e8747b81fb977b8b3bae715fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41158588946c3d6586cf6ae340c93f5deda42ced0e0c59b8f005a2e4971185a29c60892e8775092d815ab907947b1f8ebac63d43ecff9fd803661ce7cd2c9ec4
|
7
|
+
data.tar.gz: 422e8740620ddc088c99f36797443b935887d0f92ea600e91872a9e99397b65291609c047f9186a1f5e89a0ab970a311813a1f28eb2384d4243781b8f9a3691d
|
@@ -4,6 +4,7 @@ module ActionDispatch
|
|
4
4
|
# Mapper class provides methods for routes.rb
|
5
5
|
ID_FORMAT_REGEX = /\w{8}/
|
6
6
|
ID_OR_SCHEMA_FORMAT_REGEX = /\w{8}|schema\/\w+/
|
7
|
+
PAPER_TYPES = ['statutory-instruments', 'proposed-negative-statutory-instruments'].freeze
|
7
8
|
|
8
9
|
# @since 0.0.1
|
9
10
|
# Creates routes for listables
|
data/config/routes.rb
CHANGED
@@ -8,6 +8,7 @@ require_relative '../app/lib/ext/action_dispatch/routing/mapper.rb'
|
|
8
8
|
Rails.application.routes.draw do
|
9
9
|
id_format_regex = self.class::ID_FORMAT_REGEX
|
10
10
|
id_or_schema_format_regex = self.class::ID_OR_SCHEMA_FORMAT_REGEX
|
11
|
+
paper_types = self.class::PAPER_TYPES
|
11
12
|
|
12
13
|
### Root ###
|
13
14
|
# /
|
@@ -500,6 +501,18 @@ Rails.application.routes.draw do
|
|
500
501
|
# /groups/:group_id/made-available/availability-types/laid-papers
|
501
502
|
scope '/laid-papers', as: 'laid_papers' do
|
502
503
|
get '/', to: 'groups/made_available/availability_types/laid_papers#index'
|
504
|
+
|
505
|
+
# /groups/:group_id/made-available/availability-types/laid-papers/paper-types
|
506
|
+
scope '/paper-types', as: 'paper_types' do
|
507
|
+
get '/', to: 'groups/made_available/availability_types/laid_papers/paper_types#index'
|
508
|
+
end
|
509
|
+
|
510
|
+
scope '/paper-types', as: 'paper_type' do
|
511
|
+
# /groups/:group_id/made-available/availability-types/laid-papers/paper-types/:paper-type
|
512
|
+
scope '/:paper_type', constraints: lambda { |req| paper_types.include?(req.params[:paper_type]) } do
|
513
|
+
get '/', to: 'groups/made_available/availability_types/laid_papers/paper_types#show'
|
514
|
+
end
|
515
|
+
end
|
503
516
|
end
|
504
517
|
end
|
505
518
|
end
|
@@ -590,10 +603,9 @@ Rails.application.routes.draw do
|
|
590
603
|
end
|
591
604
|
|
592
605
|
scope '/paper-types', as: 'paper_type' do
|
593
|
-
# /work-packages/paper-types/:paper-type
|
594
|
-
paper_type = ['statutory-instruments', 'proposed-negative-statutory-instruments']
|
595
606
|
|
596
|
-
|
607
|
+
# /work-packages/paper-types/:paper-type
|
608
|
+
scope '/:paper_type', constraints: lambda { |req| paper_types.include?(req.params[:paper_type]) } do
|
597
609
|
get '/', to: 'work_packages/paper_types#show'
|
598
610
|
|
599
611
|
# /work-packages/paper-types/:paper-type/current
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parliament-routes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryony Watson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|