formalism-r18n_errors 0.3.1 → 0.3.2

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: d33c6c739714e6caaf127f74f7382089fd1c834778c0b5349c58e7e5d85ede68
4
- data.tar.gz: 1d6b2b6ff80bf5226ead8edfd5b9c7548aa008eb8c632b1cfc21610b3f9ea568
3
+ metadata.gz: c5b074cbfcc26e4d99f897a8efd1a6486d7620580f79c12c1dd6fa2eac467191
4
+ data.tar.gz: 43026b19edcdafdd9ea13539de43117adfdaef1a216126b4775f514c4102b0be
5
5
  SHA512:
6
- metadata.gz: 0d63d05f39d1ab9357c7f538da8d52b65db0df1d5e5cc11ac7ebbe9d37e6e13796e516ac2507afb2b7699a3545c465d039775834d608dda85021d22085ccbf7d
7
- data.tar.gz: 1eb7c9ad25b31156526250d1adc6546d588be54f65b233f28bbe8be8b26dc65bbcb4219fbbe66942b5ba43feb9dcab1ab9111af598fe1d7e74b7cd665ae5b59a
6
+ metadata.gz: 682cb30ba2053a88a7c3a145bf871d0d3e72349a0054f57f119e18605ee93bc091de743c29a45d93274a920b901fdd8c5da8297d9424e33b8ffdc5561a2296ff
7
+ data.tar.gz: 513dd406374e5f8bd9e46e8281e2dbbc7b24f285efeec5c442c5589be52ab1136de8bfe9c857752e77245f3e845dbb63a4978c13f81f540afe40c6bd82aa7611
@@ -2,8 +2,12 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 0.3.2 (2020-09-28)
6
+
5
7
  ## 0.3.1 (2020-09-28)
6
8
 
9
+ * Update `formalism` to a new version.
10
+
7
11
  ## 0.3.0 (2020-09-27)
8
12
 
9
13
  * Support endless ranges in `#validate_range_entry`.
data/README.md CHANGED
@@ -121,6 +121,10 @@ module MyProject
121
121
  ## `errors.user.email.not_valid_email`
122
122
  validate_email :email
123
123
 
124
+ ## Requires `uuid` gem
125
+ ## `errors.user.key.not_valid_uuid`
126
+ validate_uuid :key
127
+
124
128
  ## Requires `formalism-model_form` gem
125
129
  ## `errors.user.email.already_taken`
126
130
  validate_uniqueness :email
@@ -76,6 +76,19 @@ module Formalism
76
76
  valid
77
77
  end
78
78
 
79
+ ## Requires `uuid` gem
80
+ def validate_uuid(*validation_fields)
81
+ valid = true
82
+ validation_fields.flatten.each do |validation_field|
83
+ next unless field_changed?(validation_field)
84
+ next if UUID.validate public_send(validation_field)
85
+
86
+ valid = false
87
+ add_error validation_field, :not_valid_uuid
88
+ end
89
+ valid
90
+ end
91
+
79
92
  ## Requires `formalism-model_form` gem
80
93
  def validate_uniqueness(*fields_combinations)
81
94
  valid = true
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Formalism
4
4
  module R18nErrors
5
- VERSION = '0.3.1'
5
+ VERSION = '0.3.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formalism-r18n_errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '4.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: email_address
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.1.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.1.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: uuid
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.0'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: pry-byebug
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -156,14 +184,14 @@ dependencies:
156
184
  requirements:
157
185
  - - "~>"
158
186
  - !ruby/object:Gem::Version
159
- version: 0.91.0
187
+ version: 0.92.0
160
188
  type: :development
161
189
  prerelease: false
162
190
  version_requirements: !ruby/object:Gem::Requirement
163
191
  requirements:
164
192
  - - "~>"
165
193
  - !ruby/object:Gem::Version
166
- version: 0.91.0
194
+ version: 0.92.0
167
195
  - !ruby/object:Gem::Dependency
168
196
  name: rubocop-performance
169
197
  requirement: !ruby/object:Gem::Requirement