strum 0.0.49 → 0.0.50

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbaffa32e1478dab4ac3d54c36f989b67deee77417cb485c95d4414a5e5aaa08
4
- data.tar.gz: 0de5ac7bd65ab244a979059021e34ba0aed0b5a0d64753b22a70044b551f930c
3
+ metadata.gz: 4c1c6705874c71308f316381c71d65195bb0a611fd155963f0599001c27231ed
4
+ data.tar.gz: 87de1116ca26f0a7be5d21dfa9a9205a39b9edc6ed7f52234394474a72bef299
5
5
  SHA512:
6
- metadata.gz: 354a23640523229df3f3e7761c82dc694b62b8b936c72f4d9b7676ab25ab78f18e7bb06d80c2a4ad7154e881724b1c48709cf468c24a91bbee68c3514dec950f
7
- data.tar.gz: aa2900a2d0e6c5319e2870c7f4ca3723db04a6652089f990b95e5bc734eb8b156b7519830d8933b7ce44e0c4ebdfababb3ad68216541678376dc3ee97e0a7444
6
+ metadata.gz: 69b7be5b93e23a47dab9d86bd47d605684568d1615d5be6a48942513708ed37ab352e88e6bc43c7e640bc1d668b2976a67eab9991421b332c4d0ba0444ab1f0f
7
+ data.tar.gz: 2046499410c4fd0c630d6b452fc917de55c48faaed76b57a8a4f64b22c9c6be8069f45319dea5261b8f4330fc8172dc9614c8e2febccb2fd903600c30dd46782
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strum (0.0.49)
4
+ strum (0.0.51)
5
5
  dry-inflector (~> 0.2.0)
6
6
  dry-struct (~> 1.2)
7
7
  sequel (~> 5.29)
@@ -10,8 +10,13 @@
10
10
  <%= ident %> include Strum::Service
11
11
 
12
12
  <%= ident %> def call
13
- <%= ident %> output(<%= resource_class_name %>.find(input))
14
- <%= ident %> add_error(:<%= resource_name %>, :not_found) unless @output
13
+ <%= ident %> if (<%= resources_name %> = <%= resources_class_name %>::Search(input)).count.eql?(1)
14
+ <%= ident %> output(<%= resources_name %>.first)
15
+ <%= ident %> elsif <%= resources_name %>.count > 1
16
+ <%= ident %> add_error(:<%= resource_name %>, :criteria_wrong)
17
+ <%= ident %> else
18
+ <%= ident %> add_error(:<%= resource_name %>, :not_found)
19
+ <%= ident %> end
15
20
  <%= ident %> end
16
21
 
17
22
  <%= ident %> def audit
data/lib/strum/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Strum
4
- VERSION = "0.0.49"
4
+ VERSION = "0.0.50"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.49
4
+ version: 0.0.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serhiy Nazarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-14 00:00:00.000000000 Z
11
+ date: 2020-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-inflector
@@ -219,11 +219,11 @@ files:
219
219
  - lib/strum/templates/route_crud/%resource_filename%.rb.tt
220
220
  - lib/strum/templates/serializer/%resource_name%_serializer.rb.tt
221
221
  - lib/strum/templates/service/%resource_filename%.rb.tt
222
- - lib/strum/templates/service_crud/%resource_name%/create.rb.tt
223
- - lib/strum/templates/service_crud/%resource_name%/delete.rb.tt
224
- - lib/strum/templates/service_crud/%resource_name%/find.rb.tt
225
- - lib/strum/templates/service_crud/%resource_name%/search.rb.tt
226
- - lib/strum/templates/service_crud/%resource_name%/update.rb.tt
222
+ - lib/strum/templates/service_crud/%resources_name%/create.rb.tt
223
+ - lib/strum/templates/service_crud/%resources_name%/delete.rb.tt
224
+ - lib/strum/templates/service_crud/%resources_name%/find.rb.tt
225
+ - lib/strum/templates/service_crud/%resources_name%/search.rb.tt
226
+ - lib/strum/templates/service_crud/%resources_name%/update.rb.tt
227
227
  - lib/strum/version.rb
228
228
  - strum.gemspec
229
229
  homepage: https://code.qpard.com/strum/strum