error_merger 0.2.0 → 0.3.0

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
  SHA1:
3
- metadata.gz: fdfba3e2cb6c55f351c7ee4b7b0c5883cce24812
4
- data.tar.gz: f7b4196f44499e44d289eef42c838925f1ce98db
3
+ metadata.gz: 961e1f0d07b29195b46f05be818bee2acef8455f
4
+ data.tar.gz: 255b7bc2dbb513c3f1fecaaa5adfb8a180fae6d5
5
5
  SHA512:
6
- metadata.gz: 5d83cd3309db5412fbde975ac1efc1d0b86b098393511a08a5361b887c688c06b5fefa9c98be4b1b7272115050ae390fc1263c3b66845e38392839c33689c439
7
- data.tar.gz: 4dc60344e5e03b4cedce1c328e34c3c11458f95ab89a30ecb709e37d5edc9dd5870f99c668eae2eb7b20480edbc3daea484d35294836eb10692a19ca450e8cec
6
+ metadata.gz: 942ac7d8dbd548107cafcacf51cfc7d52333df35845b1ab0910e1c89ec7c43722aff4ba64dfeb94ca0429d47114f24713b441ec4efd168c15f23c15f06384b4a
7
+ data.tar.gz: ae862af43baff6cba5619d1f3cd8d303469951d48979410bac190d92b85d157d9489e101ce4fc7252272a5cff02a3b15686ca73cc70bd5eb13eebd355576a857
data/README.md CHANGED
@@ -37,6 +37,7 @@ Or install it yourself as:
37
37
 
38
38
  @user.errors.full_messages # => ["Username can't be blank"]
39
39
  @user.errors.full_sentences # => ["Username can't be blank."]
40
+ @user.errors.as_sentences # => "First name can't be blank. Last name can't be blank."
40
41
  ```
41
42
 
42
43
  By default merged errors are prefixed with the model name. In the above example, an error on User might look like: "User: First name must not be blank".
@@ -25,6 +25,10 @@ module ErrorMerger
25
25
  m.ends_with?('.') ? m : "#{m}."
26
26
  end
27
27
 
28
+ def as_sentences
29
+ full_sentences.join ' '
30
+ end
31
+
28
32
  end
29
33
 
30
34
  ActiveModel::Errors.send :include, ErrorMerger
@@ -1,3 +1,3 @@
1
1
  module ErrorMerger
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: error_merger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thomas morgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-29 00:00:00.000000000 Z
11
+ date: 2015-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Enhances the Error class on ActiveModel-compliant models with merge()
@@ -60,7 +60,7 @@ executables: []
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - .gitignore
63
+ - ".gitignore"
64
64
  - Gemfile
65
65
  - LICENSE.txt
66
66
  - README.md
@@ -79,17 +79,17 @@ require_paths:
79
79
  - lib
80
80
  required_ruby_version: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - '>='
82
+ - - ">="
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  requirements: []
91
91
  rubyforge_project:
92
- rubygems_version: 2.0.6
92
+ rubygems_version: 2.4.3
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: Enhances the Error class on ActiveModel-compliant models