much-rails 0.4.0 → 0.4.1

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: 06a9727075cd562255a4af1a8d1a37f542cda97dae2180389d6c16446ad545a9
4
- data.tar.gz: 750e9cb46067e57fbbc4bdf46181e3cf274c1a9e6eacfb04ee702cfd8268d4ff
3
+ metadata.gz: ecafeddd844c1b0413250e832370b88742ede359cb73b4b567ed4a85e2e375d6
4
+ data.tar.gz: 484ebe9506dcefe40232b5dac153f6e9d034c21b3a0f57d6b57888f740222f69
5
5
  SHA512:
6
- metadata.gz: 8a3e8f4bd80630a89fbca5bd1a88ccf83f7e99c957f81ce7c16255164cb08af8dc404e6cc2f319aba35dfe9acb9f63c91650fbbde814cb7576ecbfcce07f3295
7
- data.tar.gz: 41884fcc5e7671a4fd3faa79cef4297ececfbcc6d5ad5c3fd79e8979950dbd413ebc9b984bda7350f199585b5619878b1e7158361f96283b77fd21f8b4b1d749
6
+ metadata.gz: 6b44bb34ff3ad725bea2dbc6409830673f1553e01004b3d4476caf2b6d5dfaf5b96986d061f2a6e7ccbe3d4b5ba6a0f9108026b665dc23d9c0c9a9d2f205f77e
7
+ data.tar.gz: 064be4d568511f4ec5175f9b2ab290187e5f4bca88d25f993c2ff3762b71b541b57a8d6b8f21d38ee76680ab631a83c27c7b5bdd8e0f6ac59d6c25ad2555b28d
@@ -27,12 +27,15 @@ class MuchRails::ChangeActionResult
27
27
 
28
28
  @service_result = save_service_result
29
29
 
30
- @service_result.validation_errors ||= {}
30
+ @service_result.validation_errors ||= HashWithIndifferentAccess.new
31
31
  end
32
32
 
33
33
  def validation_errors
34
34
  @validation_errors ||=
35
- service_result.get_for_all_results(:validation_errors).to_h
35
+ service_result
36
+ .get_for_all_results(:validation_errors)
37
+ .to_h
38
+ .with_indifferent_access
36
39
  end
37
40
 
38
41
  def validation_error_messages
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MuchRails
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
data/much-rails.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |gem|
29
29
 
30
30
  gem.add_dependency("activerecord", ["> 5.0", "< 7.0"])
31
31
  gem.add_dependency("activesupport", ["> 5.0", "< 7.0"])
32
- gem.add_dependency("dassets", ["~> 0.15.2"])
32
+ gem.add_dependency("dassets", ["~> 0.15.3"])
33
33
  gem.add_dependency("dassets-erubi", ["~> 0.1.1"])
34
34
  gem.add_dependency("dassets-sass", ["~> 0.5.1"])
35
35
  gem.add_dependency("much-boolean", ["~> 0.2.1"])
@@ -78,11 +78,13 @@ class MuchRails::ChangeActionResult
78
78
  # validation_errors
79
79
  assert_that(subject.validation_errors)
80
80
  .equals({
81
- name: ["NAME ERROR"],
82
- other: ["OTHER ERROR"],
83
- empty: [],
84
- none: [nil],
81
+ "name" => ["NAME ERROR"],
82
+ "other" => ["OTHER ERROR"],
83
+ "empty" => [],
84
+ "none" => [nil],
85
85
  })
86
+ assert_that(subject.validation_errors[:name]).equals(["NAME ERROR"])
87
+ assert_that(subject.validation_errors["name"]).equals(["NAME ERROR"])
86
88
 
87
89
  # validation_error_messages
88
90
  assert_that(subject.validation_error_messages)
@@ -94,11 +96,11 @@ class MuchRails::ChangeActionResult
94
96
  # extract_validation_error
95
97
  assert_that(subject.extract_validation_error(:name))
96
98
  .equals(["NAME ERROR"])
97
- assert_that(subject.extract_validation_error(:other))
99
+ assert_that(subject.extract_validation_error("other"))
98
100
  .equals(["OTHER ERROR"])
99
101
  assert_that(subject.extract_validation_error(:empty))
100
102
  .equals([])
101
- assert_that(subject.extract_validation_error(:none))
103
+ assert_that(subject.extract_validation_error("none"))
102
104
  .equals([])
103
105
  assert_that(subject.extract_validation_error(:unknown))
104
106
  .equals([])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: much-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Redding
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-05-20 00:00:00.000000000 Z
12
+ date: 2021-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: much-style-guide
@@ -105,14 +105,14 @@ dependencies:
105
105
  requirements:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
- version: 0.15.2
108
+ version: 0.15.3
109
109
  type: :runtime
110
110
  prerelease: false
111
111
  version_requirements: !ruby/object:Gem::Requirement
112
112
  requirements:
113
113
  - - "~>"
114
114
  - !ruby/object:Gem::Version
115
- version: 0.15.2
115
+ version: 0.15.3
116
116
  - !ruby/object:Gem::Dependency
117
117
  name: dassets-erubi
118
118
  requirement: !ruby/object:Gem::Requirement