fanforce-validations 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTNiZDhhZjMyMmZhMDlhYzY3MGZlYmMzN2ZhOGVlOGNiOTg3NGQwZA==
4
+ MDY5ZjExODU4MGM3MTk0YmRiYzRjZTYzMjkwOGEzZmY0MjM0OTI3NA==
5
5
  data.tar.gz: !binary |-
6
- ODJlYmU2YTUwYjZmNWU1OWJmMzkxNGQ3N2RhOWY3MjgzNzc1YmNkMw==
6
+ MTA3NDQ5NmI4YzhhMmNiMjczMjkwNTE3YTg0NTgxN2RmNTMzNWQwNw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- M2FiN2UyOTI4ODMyNzVmMTEzZGI2OWYzZTQ5YzFmNjRkMTg0NDBjOThmZmJm
10
- NTQ5ZmE3ZmY0MzVjOGVlZGUzN2QxZTBkY2M1ZmMwYTVhM2QwNDljMmQxNTE3
11
- MmE5OWEwMjZiN2RhNWU0YTIyZTM3MjZjZWE1ZDQyNTJjYTk4NDE=
9
+ ZGM2ODVjMTIxMjcxMzk3ZWFmYTFiODNiMzgyZjcwMDc0ZTBjMTRmMDYyOGY5
10
+ NTM4YzllMzg0YzhkZGJkODY3ZmQxODVmMWEyY2MzYTVhZTlhYTRmMGU2ZTA3
11
+ MTE1M2U2ODAzMTU2MzMyOTFiYTdjMWM3Y2M0ZTdiNThjOThlOTg=
12
12
  data.tar.gz: !binary |-
13
- N2MwMDk5MzAxMTk3ZGE4OTQ5NGU0MWYyM2Q1MWJhMGY5YmRhYWQ5NGViYjM5
14
- MTAzNDg3MmQ0OGI3NmY5OTU4MWQyNjgwZDIyYjVjMmI3YWFmY2U1NzQxZjQ4
15
- MWQwNzFlOGQxZDAyYTA0YzdkOGFmYzhiNGZkZjA0NjBhNGY1YjI=
13
+ NTg3MDNkMTc4OGJjZGRhNjJkY2M0MWU0NmFhYjIxZTcyYjZjZTBlYTlmN2Qz
14
+ MDIwNTVhMmYwNDdhOWQwMWVkYjBlNTczZGU5YjE3OTI2YzhkYmY3MWI2NzY3
15
+ ZTRlYmJmYzRmNTkxMTc4ZGFlM2ZjYWEwNjY1Zjc5YTY1NDEyMDQ=
@@ -77,16 +77,14 @@ module Fanforce::Validations
77
77
  opts = extract_options!(args).merge(:field => :_external_id)
78
78
  params = extract_validation_params(opts)
79
79
 
80
- if is_present?(_external_id) and !_external_id.is_a?(String)
81
- opts[:message] = "if included, _external_id must be a string not a #{_external_id.class.name}"
82
- elsif !_external_id.nil? and _external_id.include?('/')
83
- opts[:message] = '_external_id cannot contain forward slashes (/)'
80
+ if is_present?(_external_id) and _external_id.include?('/')
81
+ opts[:message] = '_external_id contains one or more forward slashes (/), which is not allowed'
84
82
  else
85
83
  return true
86
84
  end
87
85
 
88
- error = format_validation_error(opts, :_external_id, :invalid_data)
89
- raise_validation_errors(opts, [error], Fanforce::Error::RequestFailed)
86
+ errors = [format_validation_error(opts, :_external_id, :invalid_data)]
87
+ raise_validation_errors(opts, errors, Fanforce::Error::RequestFailed)
90
88
  end
91
89
 
92
90
  def format_validation_error(opts, fields, default_error_code=nil)
@@ -1,5 +1,5 @@
1
1
  class Fanforce
2
2
  module Validations
3
- VERSION = '0.4.0'
3
+ VERSION = '0.4.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce-validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Clark