simple_activemodel_validators 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 92223014f68fe4536c457afa5bbcfd19eff6da55
4
- data.tar.gz: 05e2f6999b819b63904f0f0cf67e2a086ceb7586
3
+ metadata.gz: 485ce64d3146c9e49b0cfabdb259ae91db30f107
4
+ data.tar.gz: 80abfb92a5bf4861941d471041c23975c3f3cb60
5
5
  SHA512:
6
- metadata.gz: 6376c962c3b870a2c6b333230bda4b219819811a29cb56463bb6608c7e609f48e578b2bf130746d987dd1f10525bbd2ad90e8d5d0ce0eec76c511dd2f248156e
7
- data.tar.gz: 69f00ff48c48ef06855f6686a11ac0c4c50834afa4ab991cb110243dfd45c328de67bc274ed4f9c6a857e9ea822a7a085e706f3bbb4cda440653a62777dcdf48
6
+ metadata.gz: 0e1b3d7b5e4c09f58a312a24a6caa8f232175c6c599ff71250b411cd568ecc604cfb8bfb67087e15bfa41c5e7fb5ef2bb51a20af717d32918f972281e06a9427
7
+ data.tar.gz: 175c9ef204d99f66ec7ad1be2751db2da31fe33a43bc7f838367a3d22e3a128f8da4e99a9bd917082cd3841887135bbb413f701bd0bd0d9fd5a0e013a7af6a72
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  [![Build Status](https://travis-ci.org/decomplect-io/simple_activemodel_validators.svg)](https://travis-ci.org/decomplect-io/simple_activemodel_validators)
2
+ [![Code Climate](https://codeclimate.com/github/decomplect-io/simple_activemodel_validators/badges/gpa.svg)](https://codeclimate.com/github/decomplect-io/simple_activemodel_validators)
2
3
  # Simple ActiveModel Validators
3
4
 
4
5
  A collection of ActiveModel validators that don't pollute the global namespace.
@@ -22,10 +22,13 @@ module SimpleActiveModelValidators
22
22
  # [1]: http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#method-i-validates_associated
23
23
  class AssociatedBubblingValidator < ActiveModel::EachValidator
24
24
  # Implements the contract of `ActiveModel::EachValidator`
25
+ # @param record The record being validated
26
+ # @param attribute The name of the attribute being validated
27
+ # @param values The value of the attribute
25
28
  # @return nil
26
29
  def validate_each(record, attribute, values)
27
30
  # values can be an array or a scalar
28
- [values].flatten.reject(&:valid?).each do |value|
31
+ [values].flatten.compact.reject(&:valid?).each do |value|
29
32
  record.errors.add(attribute, value.errors.messages)
30
33
  end
31
34
  end
@@ -1,4 +1,4 @@
1
1
  module SimpleActiveModelValidators
2
2
  # Gem version
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_activemodel_validators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Decomplect Software LLP
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-23 00:00:00.000000000 Z
11
+ date: 2015-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel