hanami 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -3
- data/lib/hanami/extensions/action.rb +18 -3
- data/lib/hanami/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 81b34af999f72ddcdf23bc2e46f7ccf0309081a204ea8de05d37ff2a7a0e291d
|
|
4
|
+
data.tar.gz: 9865b0be73a46d5024e07cfcbab5ccfc83684c1e62510e350d6858d63fe2d972
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3c7e9d7e1bf9b3a5ce33b674f6dbbe29d2ac0cb8d3781af06b81a1979880fb407ead4818f146898c108c59100770c8e2e2cc769a8a7bda6d481e59349842c1e7
|
|
7
|
+
data.tar.gz: fce29da1c42fa73c7835178507bd3c14e3c68ca4a0d093427a7e05a77b9a84f2bb848a9289dcc9cc2dc2668c417d13421b1512bc003ad8ebe2059bbfd3134e84
|
data/CHANGELOG.md
CHANGED
|
@@ -35,11 +35,17 @@ A complete Hanami app is composed of multiple gems. For a complete overview of c
|
|
|
35
35
|
|
|
36
36
|
### Fixed
|
|
37
37
|
|
|
38
|
-
- Don't attempt to inherit mailer template when `hanami-view` if not bundled (@katafrakt in #1611)
|
|
39
|
-
|
|
40
38
|
### Security
|
|
41
39
|
|
|
42
|
-
[unreleased]: https://github.com/hanami/hanami/compare/v3.0.
|
|
40
|
+
[unreleased]: https://github.com/hanami/hanami/compare/v3.0.2...HEAD
|
|
41
|
+
|
|
42
|
+
## [3.0.2] - 2026-08-21
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- Prefer response exposures over request params when preparing input for the view as part of an action auto-rendering. (@timriley in #1620)
|
|
47
|
+
|
|
48
|
+
[3.0.2]: https://github.com/hanami/hanami/compare/v3.0.1...v3.0.2
|
|
43
49
|
|
|
44
50
|
## [3.0.1] - 2026-07-03
|
|
45
51
|
|
|
@@ -37,6 +37,12 @@ module Hanami
|
|
|
37
37
|
#
|
|
38
38
|
# @since 2.0.0
|
|
39
39
|
module InstanceMethods
|
|
40
|
+
# Options accepted by `Hanami::View#call` itself, which must never be given from request
|
|
41
|
+
# params.
|
|
42
|
+
#
|
|
43
|
+
# @api private
|
|
44
|
+
VIEW_RESERVED_KEYS = %i[format context layout].freeze
|
|
45
|
+
|
|
40
46
|
# @api private
|
|
41
47
|
attr_reader :view
|
|
42
48
|
|
|
@@ -89,18 +95,27 @@ module Hanami
|
|
|
89
95
|
|
|
90
96
|
private
|
|
91
97
|
|
|
92
|
-
# @api private
|
|
93
98
|
def build_response(**options)
|
|
94
99
|
options = options.merge(view_options: method(:view_options))
|
|
95
100
|
super(**options)
|
|
96
101
|
end
|
|
97
102
|
|
|
98
|
-
# @api private
|
|
99
103
|
def finish(req, res, halted)
|
|
100
|
-
res.render(view, **req
|
|
104
|
+
res.render(view, **view_input(req, res)) if !halted && auto_render?(res)
|
|
101
105
|
super
|
|
102
106
|
end
|
|
103
107
|
|
|
108
|
+
# Returns the input for the automatically rendered view.
|
|
109
|
+
#
|
|
110
|
+
# Includes response exposures as well as request params. Exposures are given precedence;
|
|
111
|
+
# these are server-set and should not be overridden by the client.
|
|
112
|
+
#
|
|
113
|
+
# Drops any keys matching the keywords for `Hanami::View#call` itself, since these are
|
|
114
|
+
# behavioral controls and the client should have no say over how the view renders.
|
|
115
|
+
def view_input(req, res)
|
|
116
|
+
{**req.params.to_h.except(*VIEW_RESERVED_KEYS), **res.exposures}
|
|
117
|
+
end
|
|
118
|
+
|
|
104
119
|
# @api private
|
|
105
120
|
def _handle_exception(request, _response, _exception)
|
|
106
121
|
super
|
data/lib/hanami/version.rb
CHANGED