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 +4 -4
- data/lib/multi_insert/query_builder.rb +2 -3
- data/lib/multi_insert/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc4fbdea86f270f216a65ede4de9f283ad443ea0
|
4
|
+
data.tar.gz: f1a8f163a22a3b1c1dd261f2e47c3bde55fb549b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/multi_insert/version.rb
CHANGED