yaaf 3.0.0 → 3.0.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/lib/yaaf/form.rb +5 -1
- data/lib/yaaf/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: 304ced3d81e0ee7a7b5dbe4d046734f368ebb577d526318e9b2bd54ff283fcea
|
4
|
+
data.tar.gz: 02ed83cff8ae59994416cb9029f2311194d73256211f30b582449184c01ac204
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd4b302b924a5f0f13332a496ee5c99974ee6e5f0490b95eadca2adb84a97fd9cf334035be50afeb633d0ee45bc5592679ef62a5d1e5172e8729e5418686baf5
|
7
|
+
data.tar.gz: d1aeef347102365d857e464fd9aadbaff6e1d4b28710806ade359ad56b8aa723f0e3476ab3b8b3be6136459fd7f92b8250d313d83ed6768fe6b7d974e9e11a1b
|
data/README.md
CHANGED
@@ -200,7 +200,7 @@ The `#errors` method will return an `ActiveModel::Errors` object such as any oth
|
|
200
200
|
|
201
201
|
### #save
|
202
202
|
|
203
|
-
The `#save` method will run validations. If it's invalid it will return `false`, otherwise it will save all the models within a DB transaction and return `true`.
|
203
|
+
The `#save` method will run validations. If it's invalid it will return `false`, otherwise it will save all the models within a DB transaction and return `true`. Models that were `#marked_for_destruction?` will be destroyed instead of saved, this can be done by calling `#mark_for_destruction` on an `ActiveRecord` model.
|
204
204
|
|
205
205
|
Defined callbacks will be called in the following order:
|
206
206
|
- `before_validation`
|
data/lib/yaaf/form.rb
CHANGED
@@ -53,7 +53,11 @@ module YAAF
|
|
53
53
|
options.merge!(validate: false)
|
54
54
|
|
55
55
|
models.map do |model|
|
56
|
-
model.marked_for_destruction?
|
56
|
+
if model.respond_to?(:marked_for_destruction?) && model.marked_for_destruction?
|
57
|
+
model.destroy!
|
58
|
+
else
|
59
|
+
model.save!(**options)
|
60
|
+
end
|
57
61
|
end
|
58
62
|
end
|
59
63
|
|
data/lib/yaaf/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaaf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Manuel Ramallo
|
8
8
|
- Santiago Bartesaghi
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-10-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -137,7 +137,7 @@ dependencies:
|
|
137
137
|
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: 1.5.0
|
140
|
-
description:
|
140
|
+
description:
|
141
141
|
email:
|
142
142
|
- juanmanuelramallo@hey.com
|
143
143
|
- santib@hey.com
|
@@ -158,7 +158,7 @@ metadata:
|
|
158
158
|
source_code_uri: https://github.com/rootstrap/yaaf
|
159
159
|
bug_tracker_uri: https://github.com/rootstrap/yaaf/issues
|
160
160
|
changelog_uri: https://github.com/rootstrap/yaaf/releases
|
161
|
-
post_install_message:
|
161
|
+
post_install_message:
|
162
162
|
rdoc_options: []
|
163
163
|
require_paths:
|
164
164
|
- lib
|
@@ -173,8 +173,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
|
-
rubygems_version: 3.
|
177
|
-
signing_key:
|
176
|
+
rubygems_version: 3.5.9
|
177
|
+
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: Easing the form object pattern in Rails applications.
|
180
180
|
test_files: []
|