unpoly-rails 3.9.2.1 → 3.9.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/assets/unpoly/unpoly.css +1 -0
- data/assets/unpoly/unpoly.es6.js +23 -16
- data/assets/unpoly/unpoly.es6.min.js +1 -1
- data/assets/unpoly/unpoly.js +23 -16
- data/assets/unpoly/unpoly.min.css +1 -1
- data/assets/unpoly/unpoly.min.js +1 -1
- data/lib/unpoly/rails/change/field_definition.rb +14 -12
- data/lib/unpoly/rails/change.rb +1 -1
- data/lib/unpoly/rails/version.rb +1 -1
- metadata +2 -2
@@ -61,10 +61,15 @@ module Unpoly
|
|
61
61
|
end
|
62
62
|
|
63
63
|
define_method "#{method}_from_request_headers" do
|
64
|
+
raw_value = send("raw_#{method}_from_request_headers")
|
65
|
+
field.parse(raw_value)
|
66
|
+
end
|
67
|
+
|
68
|
+
define_method "raw_#{method}_from_request_headers" do
|
64
69
|
header_name = send("#{method}_request_header_name")
|
65
70
|
raw_value = request.headers[header_name]
|
66
71
|
send("#{method}_request_header_accessed!")
|
67
|
-
|
72
|
+
raw_value
|
68
73
|
end
|
69
74
|
|
70
75
|
define_method "#{method}_param_name" do
|
@@ -76,29 +81,26 @@ module Unpoly
|
|
76
81
|
field.stringify(value)
|
77
82
|
end
|
78
83
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
# end
|
84
|
+
define_method "raw_#{method}_from_params" do
|
85
|
+
params[field.param_name]
|
86
|
+
end
|
83
87
|
|
84
88
|
define_method "#{method}_from_params" do
|
85
|
-
raw_value =
|
89
|
+
raw_value = send("raw_#{method}_from_params")
|
86
90
|
field.parse(raw_value)
|
87
91
|
end
|
88
92
|
|
89
93
|
define_method "#{method}_from_request" do
|
90
|
-
|
91
|
-
|
92
|
-
value = send("#{method}_from_params")
|
93
|
-
end
|
94
|
-
value
|
94
|
+
raw_value = send("raw_#{method}_from_params") || send("raw_#{method}_from_request_headers")
|
95
|
+
field.parse(raw_value)
|
95
96
|
end
|
96
97
|
|
97
98
|
define_method "write_#{method}_to_response_headers" do
|
98
99
|
value = send(method)
|
99
100
|
stringified = field.stringify(value)
|
101
|
+
|
100
102
|
if stringified.present? # app servers don't like blank header values
|
101
|
-
header_name = send("#{method}_response_header_name"
|
103
|
+
header_name = send("#{method}_response_header_name")
|
102
104
|
response.headers[header_name] = stringified
|
103
105
|
end
|
104
106
|
end
|
data/lib/unpoly/rails/change.rb
CHANGED
@@ -69,7 +69,7 @@ module Unpoly
|
|
69
69
|
# The target has changed if either:
|
70
70
|
# (1) The #target= setter was called, setting @server_target
|
71
71
|
# (2) An up[target] param was set to preserve a previously changed target through a redirect.
|
72
|
-
(@server_target && @server_target != target_from_request_headers) || target_from_params
|
72
|
+
(@server_target && @server_target != target_from_request_headers) || !!target_from_params
|
73
73
|
end
|
74
74
|
|
75
75
|
##
|
data/lib/unpoly/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unpoly-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.9.
|
4
|
+
version: 3.9.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|