coprl 3.0.0.beta.8 → 3.0.0.beta.9

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
  SHA256:
3
- metadata.gz: 75ce54746d2a84764c59cef17d5a95716ecb0fdf677fba2067443d75c3c16ddd
4
- data.tar.gz: be6092483bcb43bfe4d46ac3834fdaedc1b8ecc69ce2f6c6ad18d7e86d88f69f
3
+ metadata.gz: 236ae7548578c302ec736e18f4bc4542d37548f4a6f6cea794b80eadb263c61d
4
+ data.tar.gz: 44da31446c80059812b1839d53ddc36d91d95d8db1ac5f8c09738aae34f9da69
5
5
  SHA512:
6
- metadata.gz: 595b2f2af38f2683ba51cf4380d683a995dd007802e1b433f61d8197c8fb7893a03a67e9937d5c0f16a978ab4dfaffd0bc2d93762a993f93691d84269d41524b
7
- data.tar.gz: 12bbdfc968bde0e12e70d40a94574323d72214fbc9bd5d9a20e0c6d5ee91804ba7f07d58070a6ae79cf51c5e14b3116a26809d01ce4722101cda2e8682986136
6
+ metadata.gz: c417061bb470e7a028d82b9e699e60c96b24fee025f8fcd16c2301841ac913b6da140dad47a23c8ed7d814cf25044b2a517aff76e9e2720cc0c1bbdb5821d0a7
7
+ data.tar.gz: cde447a1e215f53bf2aec0854cac8611b05db11d49b2596a52ec1f13bd27249a84e73147a7f375a190e0bc445f17fb1508b033b3b0ad3812fa7e638772dfc3ee
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # [3.0.0-beta.9](https://github.com/rx/presenters/compare/v3.0.0-beta.8...v3.0.0-beta.9) (2021-09-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added support for api base base_url ([8f69979](https://github.com/rx/presenters/commit/8f699793de899a450df5cfb8b95015a832200178))
7
+ * fixed bug in context prep for api client ([d0558cf](https://github.com/rx/presenters/commit/d0558cf3966a9bdc91bd9d106dcb0a7ab6f56c34))
8
+
1
9
  # [3.0.0-beta.8](https://github.com/rx/presenters/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2021-09-17)
2
10
 
3
11
 
@@ -66,9 +66,9 @@ module Coprl
66
66
 
67
67
  def prepare_context(base_params = params)
68
68
  prepare_context = Presenters::Settings.config.presenters.web_client.prepare_context.dup
69
- prepare_context.push(method(:scrub_context))
69
+ prepare_context.push(method(:scrub_context)).push(method(:base_url_context))
70
70
  context = base_params.dup
71
- prepare_context.reduce(context) do |params, context_proc|
71
+ context = prepare_context.reduce(context) do |params, context_proc|
72
72
  context_proc.call(params, session, env)
73
73
  end
74
74
  context
@@ -80,6 +80,11 @@ module Coprl
80
80
  end
81
81
  params
82
82
  end
83
+
84
+ def base_url_context(params, _session, env)
85
+ params[:base_url] = "#{request.base_url}#{env['SCRIPT_NAME']}"
86
+ params
87
+ end
83
88
  end
84
89
  end
85
90
  end
@@ -5,7 +5,7 @@ module Coprl
5
5
  module Routes
6
6
  include ::Rails.application.routes.url_helpers
7
7
  def default_url_options
8
- ::Rails.application.config.action_controller.default_url_options || { :host => context[:request].host_with_port }
8
+ ::Rails.application.config.action_controller.default_url_options || { :host => context[:base_url] ? context[:base_url] : context[:request].host_with_port }
9
9
  end
10
10
  end
11
11
  end
@@ -1,7 +1,7 @@
1
1
  module Coprl
2
2
  module Presenters
3
3
  module Version
4
- VERSION = '3.0.0.beta.8'
4
+ VERSION = '3.0.0.beta.9'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coprl
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.beta.8
4
+ version: 3.0.0.beta.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Edens
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-17 00:00:00.000000000 Z
11
+ date: 2021-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ice_nine