human_error 1.8.1 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/human_error/persistable.rb +4 -6
- data/lib/human_error/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84204722cea575f9bda9333cd31e1a29f85351e0
|
4
|
+
data.tar.gz: 2d6bfc6135ce80475dcefad49454917dbb69fb4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e79817c0b8aeb3d4af7b037e7f11ca6b0dc3eef7c3a413fd085c6c1c501b42e674c613dac35044eb9a0a95c1e20248ece404580bc06cdabd985f07a6baf86f9
|
7
|
+
data.tar.gz: db9eec83c9ce4cec175b908a91a2b0373b186822ff82b3b86aa321a0d98c4f5089b4418286d5dc861b1fb92c93fe37ab2d5ac4d34c46585c9a90e23184f7c692
|
@@ -14,7 +14,7 @@ module Persistable
|
|
14
14
|
end
|
15
15
|
|
16
16
|
raise HumanError::Errors::ResourceNotFoundError.new(
|
17
|
-
resource_name: human_error_resource_name(self),
|
17
|
+
resource_name: Persistable.human_error_resource_name(self),
|
18
18
|
resource_id: ids)
|
19
19
|
end
|
20
20
|
end
|
@@ -28,18 +28,18 @@ module Persistable
|
|
28
28
|
[1..-1]
|
29
29
|
|
30
30
|
raise HumanError::Errors::AssociationError.new(
|
31
|
-
resource_name: human_error_resource_name(self.class),
|
31
|
+
resource_name: Persistable.human_error_resource_name(self.class),
|
32
32
|
association_name: association_name,
|
33
33
|
association_id: association_id,
|
34
34
|
attributes: attributes)
|
35
35
|
rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotSaved => e
|
36
36
|
raise HumanError::Errors::ResourcePersistenceError.new(
|
37
|
-
resource_name: human_error_resource_name(self.class),
|
37
|
+
resource_name: Persistable.human_error_resource_name(self.class),
|
38
38
|
attributes: attributes,
|
39
39
|
errors: errors.full_messages)
|
40
40
|
end
|
41
41
|
|
42
|
-
def human_error_resource_name(klass)
|
42
|
+
def self.human_error_resource_name(klass)
|
43
43
|
last_part_of_class_name = /::(\w+)\z/
|
44
44
|
|
45
45
|
klass.
|
@@ -49,8 +49,6 @@ module Persistable
|
|
49
49
|
downcase
|
50
50
|
end
|
51
51
|
|
52
|
-
module_function :human_error_resource_name
|
53
|
-
|
54
52
|
def self.included(base)
|
55
53
|
base.extend ClassMethods
|
56
54
|
end
|
data/lib/human_error/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: human_error
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jfelchner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|