fanforce-validations 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/fanforce/validations/validations.rb +0 -15
- data/lib/fanforce/validations/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjA1NmNjZmQ3OGEzMzZhMTYwMjgwYTdiYThkZDY5NDFlNmI0NGE0Yg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzUwMmVkNDU5YTVkOGQyN2FkM2ZlNWUxYzIxMzRhM2M1NmU3MzllOQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjA3ZDAyZmVlNjgwNjRhMmE4MzBiMTE2Mzk3MWI4ZGM3ODhkMjMyZTFkM2Rk
|
10
|
+
ZmY5YmJiMzM3YzE1NWEwYjNmODcyMDE5NzhhNGExZjc1NTMxOTJmYTg5MjJh
|
11
|
+
OTlkN2UyMmE3ZDQ0YWE3YWI4MjMwMDdmODE3ZGRjNjZkYjdiMWE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmUwYjc0ODFhZGNlMjAyM2MxNWM2ZTVkYWFkMmYxZTdjMjc1ZmJkNjkzZTFj
|
14
|
+
YmIxNjBlYzExYjVkNDU2OTllMWY2ZTRkOWNiMTI5YWIyZWIyNTQzYmQwNjNk
|
15
|
+
MzY5MDIyOGI1NjRmZTA2MWZmNzE2YWVlNzE2MjUzNDQ1MzZiOTk=
|
@@ -72,21 +72,6 @@ module Fanforce::Validations
|
|
72
72
|
raise_validation_errors(opts, errors, Fanforce::Error::RequestFailed)
|
73
73
|
end
|
74
74
|
|
75
|
-
def validates_format_of_external_id(*args)
|
76
|
-
_external_id = args.first
|
77
|
-
opts = extract_options!(args).merge(:field => :_external_id)
|
78
|
-
params = extract_validation_params(opts)
|
79
|
-
|
80
|
-
if _external_id.to_s.include?('/')
|
81
|
-
opts[:message] = '_external_id contains one or more forward slashes (/), which is not allowed'
|
82
|
-
else
|
83
|
-
return true
|
84
|
-
end
|
85
|
-
|
86
|
-
errors = [format_validation_error(opts, :_external_id, :invalid_data)]
|
87
|
-
raise_validation_errors(opts, errors, Fanforce::Error::RequestFailed)
|
88
|
-
end
|
89
|
-
|
90
75
|
def format_validation_error(opts, fields, default_error_code=nil)
|
91
76
|
error = {
|
92
77
|
resource: is_present?(opts[:resource]) ? opts[:resource] : (self.class==Class ? self.name.demodulize.tableize.singularize : self.class.name.demodulize.tableize.singularize),
|