flexirest 1.2.8 → 1.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ee683d1b85b87d73a3dda5878c6cb07721b59ad
4
- data.tar.gz: 1bb960ed02707f499bbacb8c0b7063448a2b1d58
3
+ metadata.gz: 81462a92874dcd46c379c35a305f9fa6c0cfbdea
4
+ data.tar.gz: fad159ec5aa84dc8f60e840f18a8ea161101cbd8
5
5
  SHA512:
6
- metadata.gz: 1d79c8cdbfd32d31ea9709c45fa2a7a6bbd3046d6c5f1b87f449b4719bb746dbfc689de7bb0c59f50b52a580febed42df130813da7364a3543584aaf40bf8b0c
7
- data.tar.gz: 4d8cca00a320ec1b346b71c800d9ff7c7b6eefc4297cd4d2a88b9f916cef10db2ddef3d556bc21fe04837bd25c67d0b0022cce08cd4ea4f216a8823b90973252
6
+ metadata.gz: d5354c2a387defe3e442edd48a41fc859e9c52143785cd13c3f119c7b3e3e0e3d4a88eed08aed1392c7a37de687dfc4c2611e4fec3fcd098f15179e1a0e96951
7
+ data.tar.gz: 273024d2280a99e634bea16561f6d364842a6dc88335993751d46ed658bac0323ad5dc859a3187f610b536475a504488b6d42d93a7f2cf45eafd05132e32b162
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.9
4
+
5
+ Bugfixes:
6
+
7
+ - Fixing messages used during validation of maximum numericality (thanks Tom Hoen)
8
+
3
9
  ## 1.2.8
4
10
 
5
11
  Bugfixes:
@@ -30,7 +30,7 @@ module Flexirest
30
30
  elsif type == :existence
31
31
  if value.nil?
32
32
  @errors[validation[:field_name]] << "must be not be nil"
33
- end
33
+ end
34
34
  elsif type == :length
35
35
  if options[:within]
36
36
  @errors[validation[:field_name]] << "must be within range #{options[:within]}" unless options[:within].include?(value.to_s.length )
@@ -39,7 +39,7 @@ module Flexirest
39
39
  @errors[validation[:field_name]] << "must be at least #{options[:minimum]} characters long" unless value.to_s.length >= options[:minimum]
40
40
  end
41
41
  if options[:maximum]
42
- @errors[validation[:field_name]] << "must be no more than #{options[:minimum]} characters long" unless value.to_s.length <= options[:maximum]
42
+ @errors[validation[:field_name]] << "must be no more than #{options[:maximum]} characters long" unless value.to_s.length <= options[:maximum]
43
43
  end
44
44
  elsif type == :numericality
45
45
  numeric = (true if Float(value) rescue false)
@@ -51,7 +51,7 @@ module Flexirest
51
51
  @errors[validation[:field_name]] << "must be at least #{options[:minimum]}" unless value.to_f >= options[:minimum]
52
52
  end
53
53
  if options[:maximum]
54
- @errors[validation[:field_name]] << "must be no more than #{options[:minimum]}" unless value.to_f <= options[:maximum]
54
+ @errors[validation[:field_name]] << "must be no more than #{options[:maximum]}" unless value.to_f <= options[:maximum]
55
55
  end
56
56
  end
57
57
  end
@@ -74,7 +74,7 @@ module Flexirest
74
74
  return "" unless _errors.present?
75
75
  _errors.reduce([]) do |memo, (field, errors)|
76
76
  memo << "#{field.to_s} #{errors.join(' and ')}"
77
- end
77
+ end
78
78
  end
79
79
 
80
80
  def _errors
@@ -1,3 +1,3 @@
1
1
  module Flexirest
2
- VERSION = "1.2.8"
2
+ VERSION = "1.2.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexirest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.8
4
+ version: 1.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-14 00:00:00.000000000 Z
11
+ date: 2015-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler