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 +4 -4
- data/CHANGELOG.rdoc +4 -0
- data/lib/nilify_blanks/matchers.rb +3 -1
- data/lib/nilify_blanks/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 104027ca97e31a737161c1c4af5c61a2bcf69242
|
4
|
+
data.tar.gz: 5e623701c93fd3a53ea116165b07aa2e83249fb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aca3952cac7d12a89986c78f964e245624fe80ba4bf4e27aee3106b4a66e68f2234422f8c421876234f02b323347a2620d607416226520b01df5101745934069
|
7
|
+
data.tar.gz: ba4a2adc8b2e106186f0723000cfbd2bf81b25205b1565419d710c66af0a5f57cc24c5726920507f5af6baa323a78195a44d456c827d65c662c3e9f4fb611066
|
data/CHANGELOG.rdoc
CHANGED
@@ -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
|
|
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.
|
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-
|
11
|
+
date: 2015-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|