active_transaction 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_transaction/version.rb +1 -1
- data/lib/generators/templates/contract.rb.erb +10 -12
- data/lib/generators/templates/contract_spec.rb.erb +1 -1
- data/lib/generators/templates/transaction.rb.erb +7 -9
- data/lib/generators/templates/transaction_spec.rb.erb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 630c7d1cc5b8674ad0e5525210dd396a96573e5d99a73255acfec94f55e0c26f
|
4
|
+
data.tar.gz: e282ac6b745de4b84011f548221545af7430a404e44bd9d2ee56af6f54dc6a62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ff12d7ba2b5f7c278151face5c015beeffa684b7e1c19812e1d1b7fc6203f30b35a681e38af8077c7e982e9c57d705ceadac01cc4dd10bb764014b873bb9191
|
7
|
+
data.tar.gz: 67049e727d4c8654f45a925ac096d38d804e3c7dc656ed61a46f097ce77b759c31947f90237ea2467f4bfd41edc1e43a13abf6af53d9db7426955527cc209e6f
|
@@ -1,16 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
optional(:<%= params[0] %>).maybe(:<%= params[2] %>)
|
3
|
+
class <%= class_name %>Contract < ActiveTransaction::ApplicationContract
|
4
|
+
params do
|
5
|
+
<% fields.each do |field| %>
|
6
|
+
<% params = field.split(':') %>
|
7
|
+
<% if params[1] == 'optional' %>
|
8
|
+
optional(:<%= params[0] %>).maybe(:<%= params[2] || 'string' %>)
|
10
9
|
<% else %>
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
10
|
+
required(:<%= params[0] %>).filled(:<%= params[1] || 'string' %>)
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
15
13
|
end
|
16
|
-
end
|
14
|
+
end
|
@@ -1,16 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
step :<%= step %>
|
3
|
+
class <%= class_name %>Transaction < ActiveTransaction::ApplicationTransaction
|
4
|
+
<% steps.each do |step| %>
|
5
|
+
step :<%= step %>
|
7
6
|
<% end %>
|
8
7
|
|
9
8
|
private
|
10
9
|
|
11
10
|
<% steps.each do |step| %>
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
11
|
+
|
12
|
+
def <%= step %>(input); end
|
13
|
+
<% end %>
|
14
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_transaction
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aram
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-transaction
|