hyperactiveform 0.4.1 → 0.5.0
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 +3 -0
- data/README.md +9 -0
- data/context7.json +4 -0
- data/docs/FormGenerator.html +11 -7
- data/docs/HyperActiveForm/Base.html +215 -115
- data/docs/HyperActiveForm/CancelFormSubmit.html +10 -7
- data/docs/HyperActiveForm/FormDidNotSubmitError.html +10 -7
- data/docs/HyperActiveForm/Generators/InstallGenerator.html +11 -7
- data/docs/HyperActiveForm/Generators.html +10 -7
- data/docs/HyperActiveForm.html +12 -9
- data/docs/Hyperactiveform_.html +146 -0
- data/docs/Rspec/Generators/FormGenerator.html +11 -7
- data/docs/Rspec/Generators.html +10 -7
- data/docs/Rspec.html +10 -7
- data/docs/TestUnit/Generators/FormGenerator.html +11 -7
- data/docs/TestUnit/Generators.html +10 -7
- data/docs/TestUnit.html +10 -7
- data/docs/_index.html +20 -13
- data/docs/class_list.html +6 -6
- data/docs/css/common.css +1 -1
- data/docs/css/full_list.css +201 -53
- data/docs/css/style.css +988 -402
- data/docs/file.README.html +29 -78
- data/docs/file_list.html +5 -5
- data/docs/frames.html +1 -1
- data/docs/index.html +29 -78
- data/docs/js/app.js +800 -343
- data/docs/js/full_list.js +332 -240
- data/docs/method_list.html +5 -5
- data/docs/top-level-namespace.html +9 -7
- data/gemfiles/{Gemfile.rails-8.x → Gemfile.rails-8.0.x} +1 -1
- data/gemfiles/Gemfile.rails-8.1.x +5 -0
- data/lib/hyper_active_form/base.rb +19 -7
- data/lib/hyper_active_form/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e80d005bd550a0977af745a9f13660cb17bf32b87ddb7e496df3452741b689c4
|
|
4
|
+
data.tar.gz: 066a4d825873a0786ce3c6f6a8317a2e7426522774e93bc53494922eb5e58105
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 026d4b6c200c4f82011da1f48621538702ab3d7b7bb33fd5d8136d9654bc5abcfaa62264d6c6b31e20097112c0d6898ea4639bccf380a250dc7dc0e3e4630704
|
|
7
|
+
data.tar.gz: 9cfb34b94c1324cec8f94176f2572d95f66cb3609478dcbf003148f0e563839b4f68b7a3b91b0e17279db17b783783f85f0ff554053b4d01b9379c1d2f956df0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.5.0] - 2026-08-25
|
|
4
|
+
- Add the `overwrite_missing: false` option to `submit`, `submit!`, and `assign_form_attributes` to preserve current values for missing attributes instead of overwriting them with their default value or nil.
|
|
5
|
+
|
|
3
6
|
## [0.4.1] - 2025-05-12
|
|
4
7
|
- Fixes a bug where if params contained expected falsey values, the form would treat them as nil.
|
|
5
8
|
for instance `form.submit({likes_cat: false})` would set `likes_cat` to nil instead of false.
|
data/README.md
CHANGED
|
@@ -147,6 +147,15 @@ The `perform` method is where you should do the actual form logic, like updating
|
|
|
147
147
|
|
|
148
148
|
If the return value of `perform` is not truthy, `HyperActiveForm` will consider the form encountered an error and `submit` will return `false`, or `submit!` will raise a `HyperActiveForm::FormDidNotSubmitError`.
|
|
149
149
|
|
|
150
|
+
By default, `submit` and `assign_form_attributes` overwrite attributes that are missing from the params with their default value or `nil`. Pass `overwrite_missing: false` with an explicit params hash to preserve their current values:
|
|
151
|
+
|
|
152
|
+
```ruby
|
|
153
|
+
@form.submit({ first_name: "John" }, overwrite_missing: false)
|
|
154
|
+
@form.assign_form_attributes({ first_name: "John" }, overwrite_missing: false)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Explicitly provided values, including `nil`, are still assigned. `submit!` accepts the same option.
|
|
158
|
+
|
|
150
159
|
At any point during the form processing, you can raise `HyperActiveForm::CancelForm` to cancel the form submission, this is the same as returning `false`.
|
|
151
160
|
|
|
152
161
|
## Understanding add_errors_from
|
data/context7.json
ADDED
data/docs/FormGenerator.html
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
<title>
|
|
7
7
|
Class: FormGenerator
|
|
8
8
|
|
|
9
|
-
— Documentation by YARD 0.9.
|
|
9
|
+
— Documentation by YARD 0.9.45
|
|
10
10
|
|
|
11
11
|
</title>
|
|
12
12
|
|
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css"
|
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css">
|
|
14
14
|
|
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css"
|
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css">
|
|
16
16
|
|
|
17
17
|
<script type="text/javascript">
|
|
18
18
|
pathId = "FormGenerator";
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
|
|
28
28
|
</head>
|
|
29
29
|
<body>
|
|
30
|
+
<div id="main_progress" aria-hidden="true"></div>
|
|
31
|
+
|
|
30
32
|
<div class="nav_wrap">
|
|
31
33
|
<iframe id="nav" src="class_list.html?1"></iframe>
|
|
32
34
|
<div id="resizer"></div>
|
|
@@ -96,7 +98,8 @@
|
|
|
96
98
|
|
|
97
99
|
<dl>
|
|
98
100
|
<dt>Defined in:</dt>
|
|
99
|
-
<dd>lib/generators/form/form_generator.rb
|
|
101
|
+
<dd>lib/generators/form/form_generator.rb
|
|
102
|
+
</dd>
|
|
100
103
|
</dl>
|
|
101
104
|
|
|
102
105
|
</div>
|
|
@@ -139,6 +142,7 @@
|
|
|
139
142
|
|
|
140
143
|
|
|
141
144
|
</ul>
|
|
145
|
+
|
|
142
146
|
|
|
143
147
|
|
|
144
148
|
|
|
@@ -183,11 +187,11 @@
|
|
|
183
187
|
</div>
|
|
184
188
|
|
|
185
189
|
<div id="footer">
|
|
186
|
-
Generated on
|
|
190
|
+
Generated on Tue Aug 25 18:22:24 2026 by
|
|
187
191
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
188
|
-
0.9.
|
|
192
|
+
0.9.45 (ruby-4.0.6).
|
|
189
193
|
</div>
|
|
190
194
|
|
|
191
195
|
</div>
|
|
192
196
|
</body>
|
|
193
|
-
</html>
|
|
197
|
+
</html>
|