nilify_blanks 1.2.0 → 1.2.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: 147eedddbcf8457a7c757412cce81940c86d1fb6
4
- data.tar.gz: 450434dcb83a650cdd55888ade81446cdfbd83e5
3
+ metadata.gz: 104027ca97e31a737161c1c4af5c61a2bcf69242
4
+ data.tar.gz: 5e623701c93fd3a53ea116165b07aa2e83249fb9
5
5
  SHA512:
6
- metadata.gz: bb52fe0798a8626942bd7838001e14b645566f0b2c75698b5cd54e76962c6ebb2bf2bf0bcf7a0eb8c68c7686b679a76701f12e2917e89d15d0bcfa243a2dea4c
7
- data.tar.gz: 86251ee4ce3b7972fab0890891092ff3fa4c2d5f8201cfc3e4e2a4e0f0ba5bda870ebbb2e06b19f54b1b36c7559c37f1f375f0b59dca02c2b9f272c9c41c5333
6
+ metadata.gz: aca3952cac7d12a89986c78f964e245624fe80ba4bf4e27aee3106b4a66e68f2234422f8c421876234f02b323347a2620d607416226520b01df5101745934069
7
+ data.tar.gz: ba4a2adc8b2e106186f0723000cfbd2bf81b25205b1565419d710c66af0a5f57cc24c5726920507f5af6baa323a78195a44d456c827d65c662c3e9f4fb611066
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ == [2015-04-12] 1.2.1
2
+
3
+ * Fix inconsistency in nilify_blanks RSpec matcher: should filter by type
4
+
1
5
  == [2014-07-04] 1.2.0
2
6
 
3
7
  * Drop support for ruby 1.8.7 and 1.9.2 - too many issues with backwards-compatibility
@@ -37,11 +37,13 @@ end
37
37
 
38
38
  Kernel.const_get(rspec_module)::Matchers.define :nilify_blanks do |options = {}|
39
39
  match do |model_instance|
40
+ options[:types] = options[:types] ? Array.wrap(options[:types]).map(&:to_sym) : NilifyBlanks::ClassMethods::DEFAULT_TYPES
41
+
40
42
  model_class = model_instance.class
41
43
  model_class.define_attribute_methods
42
44
  model_class.included_modules.include?(NilifyBlanks::InstanceMethods) &&
43
45
  model_class.respond_to?(:nilify_blanks_columns) &&
44
- model_class.nilify_blanks_columns == model_class.content_columns.select(&:null).map(&:name).map(&:to_s) &&
46
+ model_class.nilify_blanks_columns == model_class.content_columns.select(&:null).select {|c| options[:types].include?(c.type) }.map(&:name).map(&:to_s) &&
45
47
  options.all? {|k, v| model_class.instance_variable_get(:@_nilify_blanks_options)[k] == v }
46
48
  end
47
49
 
@@ -1,3 +1,3 @@
1
1
  module NilifyBlanks
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nilify_blanks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Hughes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-04 00:00:00.000000000 Z
11
+ date: 2015-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport