nullify_empty 0.1.1 → 0.1.2

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: b1cd0566cb64431a07fc94a4040fbf936ccc6dad
4
- data.tar.gz: 6db5506decdafe3eff4a44fb792b50ab37838336
3
+ metadata.gz: db799c587efb2abc57083a9783e3fabce13928b1
4
+ data.tar.gz: 650ffce2ba63acc8c339055badde98b50e0077d1
5
5
  SHA512:
6
- metadata.gz: 8f0cf076c473576bc9d8ea86de3795d202a4dedbebc1979ad4ada9f655e1e6e825379c4391dce3015e25a71646bb78c9783bd9bd1aa4c822b3b3534ff25b46b8
7
- data.tar.gz: 3c3600588a6c07b05aa7c5674eb2d59551e6ba59bbf069e188e9bea6125e5e29d43cb6cdb83f478d1ae00433680c6a79eea6590ffc499ad63087d5063b287c9f
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
@@ -1,3 +1,3 @@
1
1
  module NullifyEmpty
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-10-30 00:00:00.000000000 Z
11
+ date: 2017-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord