multi_insert 0.2.0 → 0.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: 832a9abb0d1f4a46f8f0a751ec1dce7a93cc01de
4
- data.tar.gz: 415a740b0be619998f708ae58fd8144155327be9
3
+ metadata.gz: fc4fbdea86f270f216a65ede4de9f283ad443ea0
4
+ data.tar.gz: f1a8f163a22a3b1c1dd261f2e47c3bde55fb549b
5
5
  SHA512:
6
- metadata.gz: 1dbe2dd054728c86813136dbc22ce6484c6cdd3c508fea3dcc6bde96ed3fa73a197bfcbccdd0dc5442ab3cb9971e138bb2c0d3a481a498c80d2c0c0b5f0a37aa
7
- data.tar.gz: 8a6474bcd0c7099ab5737b3a38736167e1eea0e0516914d3ed4a88b2e2553bcf7b994c289fa6cfd77891b2313291daf0805d85ef27e7143f7748190f8f54b277
6
+ metadata.gz: 25ab114fd113733f6d6eebc55b6a9823dcdbe50a67d8613de9ff8116386acc915dff79197aff2e4925a6dfc1b3b1856e963f03c70f20e2ea46d1b9ec69fb9561
7
+ data.tar.gz: ee85021afd8623963c931a16757b577e5f875cf1d711cba08de4fe57a3a30dfac8d3837a94a5849d6683961bd5cfb9d21eddfafbad7e5b9da1a64213106b601c
@@ -45,8 +45,7 @@ module MultiInsert
45
45
  def self.on_conflict_do_update(column, values, opts = {})
46
46
  opts = INSERT_DEFAULTS.merge(opts)
47
47
  if values.is_a?(Symbol) || values.is_a?(String)
48
- tmp = {}
49
- tmp[values] = :excluded
48
+ values = { values => :excluded }
50
49
  elsif values.is_a?(Array)
51
50
  values = values.product([:excluded]).to_h
52
51
  end
@@ -56,7 +55,7 @@ module MultiInsert
56
55
  end
57
56
  values.map! do |key, value|
58
57
  v = nil
59
- key = ActiveRecord::Base.connection.quote_column_name(key)
58
+ key = ActiveRecord::Base.connection.quote_column_name(key.to_s)
60
59
  if value == :excluded
61
60
  v = "excluded.#{key}"
62
61
  else
@@ -1,3 +1,3 @@
1
1
  module MultiInsert
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_insert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nax