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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -0
- data/lib/formalism/r18n_errors/validation_helpers.rb +13 -0
- data/lib/formalism/r18n_errors/version.rb +1 -1
- metadata +31 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5b074cbfcc26e4d99f897a8efd1a6486d7620580f79c12c1dd6fa2eac467191
|
4
|
+
data.tar.gz: 43026b19edcdafdd9ea13539de43117adfdaef1a216126b4775f514c4102b0be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 682cb30ba2053a88a7c3a145bf871d0d3e72349a0054f57f119e18605ee93bc091de743c29a45d93274a920b901fdd8c5da8297d9424e33b8ffdc5561a2296ff
|
7
|
+
data.tar.gz: 513dd406374e5f8bd9e46e8281e2dbbc7b24f285efeec5c442c5589be52ab1136de8bfe9c857752e77245f3e845dbb63a4978c13f81f540afe40c6bd82aa7611
|
data/CHANGELOG.md
CHANGED
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
|
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.
|
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.
|
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.
|
194
|
+
version: 0.92.0
|
167
195
|
- !ruby/object:Gem::Dependency
|
168
196
|
name: rubocop-performance
|
169
197
|
requirement: !ruby/object:Gem::Requirement
|