nullify_empty 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nullify_empty/active_record_extension.rb +2 -2
- data/lib/nullify_empty/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: db799c587efb2abc57083a9783e3fabce13928b1
|
4
|
+
data.tar.gz: 650ffce2ba63acc8c339055badde98b50e0077d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 492428f98f4d5b0d0ab8b8e7b06b124a95caec2cbd04de179c5fe0f350ff914c29b3b44d8b8184e89fa695b0737b9d0593f73fef64363cefb0212bfe8f3836af
|
7
|
+
data.tar.gz: 4fbfffda74ac177f900dca786074d201de816c52eb89f72c51238ad548bfe10fa52adeb39b16f9b1be2aa85b179b325300cd70fa9352dd79bc8182ba8b03cb78
|
@@ -3,10 +3,10 @@ module NullifyEmpty
|
|
3
3
|
def nullify_empty(*attr_names)
|
4
4
|
return unless connection.table_exists? table_name
|
5
5
|
|
6
|
-
attr_names.each do |attr_name|
|
6
|
+
(column_names & attr_names.map(&:to_s)).each do |attr_name|
|
7
7
|
original_type_klass = attribute_types[attr_name.to_s].class
|
8
8
|
|
9
|
-
new_type_klass =
|
9
|
+
new_type_klass =
|
10
10
|
NULLIFY_EMPTY_TYPES.find { |_, klass| klass.superclass == original_type_klass }.first
|
11
11
|
|
12
12
|
attribute attr_name, new_type_klass
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nullify_empty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Chumakov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|