active_transaction 0.1.0 → 0.1.1
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/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: a16cca2503e2bb8c8428d116a5397782eaeb80836dddc6c18745f2ee7dca9697
         | 
| 4 | 
            +
              data.tar.gz: 57a52045ec0e8acee9d94204dde41b869b62e0c170f3fac666836be0343db22f
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 56ce74aadd5caf625d3c29e489c3a7a0bea5efeb63cc88cc9e00516c1bdb82f7ef4795d2b56cfa9101a86b649bd44928e0a387edf12b6f2a5af88349267fdcc1
         | 
| 7 | 
            +
              data.tar.gz: 12d745ead7612a8161fc3affa71d66bfe2d756ee85a7ffe130e8f2815779cf3a7e452c4df30ad8953b79d81d19dc9d9c2d31cd3c040c0675c005c18493719e1e
         | 
| @@ -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] %>)
         | 
| 10 9 | 
             
                  <% else %>
         | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
                end
         | 
| 10 | 
            +
                required(:<%= params[0] %>).filled(:<%= params[1] %>)
         | 
| 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.1
         | 
| 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
         |