service_pattern 1.0.9 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc1d86311bd4cf4a8bd24e9261f1e7cc7bde638786699be7d859c1b6a8259e6f
4
- data.tar.gz: 7874ffb81a44c4d6c05f281026e7926e5cf5b62b64aa0479d4eb76fc3620ed87
3
+ metadata.gz: 94ca486bb1607f167123d393bc42c03f7786430a83eff2628c5e07099332fdc7
4
+ data.tar.gz: 6c8f24a858cb72f8e5766fb5ff78508bd7d98d5598ab2d0a31a8daf67c5d5620
5
5
  SHA512:
6
- metadata.gz: b16d78da76eb279b919e28fa1dcdb9ec8d4a84cd44b2008bd002522112be7fdaef68037fe80646d1d87398e02cf86775f40b38510ea9d39452d58cc9c58228c8
7
- data.tar.gz: 28f526d8a9516d1bff202a708e789f3fec76452d1240b8281ade421b4d7fb3b3b8979c92ebb93b38e355cd9a5765fa8732954ff90205bb6c09e4c7f330e9dc64
6
+ metadata.gz: 0ba2a11e72514b6e9db753c6c6e63327ff815456ba563f755ee258b42d6550fbbb37fdd73eaa9188c63d88b1a6cde5ea2271884a6cc8263e3dc192d04d140d4f
7
+ data.tar.gz: dcd0e3e808ac4c8aec52f24c4ad58dc33af96af830892c7e32cc65490f43c5b8d52f6f3f8712f7e0b788c43ee2fd6d71fcff8649d527ed156de02c1cd00fd74e
@@ -1,7 +1,7 @@
1
1
  class ServicePattern::ModelsSave < ServicePattern::Service
2
2
  attr_reader :models, :simple_model_errors
3
3
 
4
- def initialize(models:, simple_model_errors: false)
4
+ def initialize(models:, simple_model_errors: true)
5
5
  @models = models
6
6
  @simple_model_errors = simple_model_errors
7
7
  end
@@ -113,7 +113,7 @@ class ServicePattern::Service
113
113
  ServicePattern::Service.fail!(errors)
114
114
  end
115
115
 
116
- def save_models_or_fail(*models, simple_model_errors: false)
116
+ def save_models_or_fail(*models, simple_model_errors: true)
117
117
  ServicePattern::ModelsSave.execute!(models: models, simple_model_errors: simple_model_errors)
118
118
  end
119
119
 
@@ -1,4 +1,4 @@
1
- class ServicePattern::SimpleModelErrors
1
+ class ServicePattern::SimpleModelErrors < ServicePattern::Service
2
2
  attr_reader :additional_attributes, :errors, :model, :models_inspected
3
3
 
4
4
  def initialize(model:, additional_attributes: [])
@@ -10,7 +10,7 @@ class ServicePattern::SimpleModelErrors
10
10
 
11
11
  def perform
12
12
  inspect_model(model)
13
- errors
13
+ succeed!(errors)
14
14
  end
15
15
 
16
16
  def inspect_model(model_to_inspect)
@@ -1,3 +1,3 @@
1
1
  module ServicePattern
2
- VERSION = "1.0.9".freeze
2
+ VERSION = "1.0.10".freeze
3
3
  end
@@ -8,5 +8,5 @@ module ServicePattern
8
8
  autoload :ModelsSave, "#{path}/models_save"
9
9
  autoload :Response, "#{path}/response"
10
10
  autoload :Service, "#{path}/service"
11
- autoload :SimpleModelsError, "#{path}/simple_models_errors"
11
+ autoload :SimpleModelErrors, "#{path}/simple_model_errors"
12
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: service_pattern
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaspernj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-02 00:00:00.000000000 Z
11
+ date: 2022-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -166,7 +166,7 @@ files:
166
166
  - lib/service_pattern/models_save.rb
167
167
  - lib/service_pattern/response.rb
168
168
  - lib/service_pattern/service.rb
169
- - lib/service_pattern/simple_models_errors.rb
169
+ - lib/service_pattern/simple_model_errors.rb
170
170
  - lib/service_pattern/version.rb
171
171
  - lib/tasks/service_pattern_tasks.rake
172
172
  homepage: https://www.github.com/kaspernj/service_pattern