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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4fd2ad173b77f8cab34984f84496840e1895f5dd
4
- data.tar.gz: e2faf0dbf1b138dd8ab746982b9a5086573abc41
3
+ metadata.gz: 89c922f98b164f4628b0b4b71522b6dc157a5c1a
4
+ data.tar.gz: e10e882d4765eb2e8747b81fb977b8b3bae715fe
5
5
  SHA512:
6
- metadata.gz: 03443304c0f03e07ef4ee41c74283547e4f746b50fe2025babc56df7c0a5669a9dc79ffd32c6cf48e4ac6cf8b7244a49e6e550fb7e4a9cfee30621b10ae132c7
7
- data.tar.gz: 86344f73cdd146ec22fb11b3bda83a57520b8a71728536fe6763d54f9fec545e42d14b2378db93a2ea008d1647f88d536dbac3315e60c68de23a4c772727cc9b
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
- scope '/:paper_type', constraints: lambda { |req| paper_type.include?(req.params[:paper_type]) } do
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
@@ -1,5 +1,5 @@
1
1
  module Parliament
2
2
  module Engine
3
- VERSION = '0.6.25'.freeze
3
+ VERSION = '0.6.26'.freeze
4
4
  end
5
5
  end
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.25
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-12 00:00:00.000000000 Z
11
+ date: 2018-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails