activerecord-insert_many 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/activerecord/insert_many.rb +3 -1
- data/lib/activerecord/insert_many/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: f7fc9b46ec30b57c6cdb792933adc263f8ad220f
|
4
|
+
data.tar.gz: a73452740ba07ac8e9df7b4fedd0c5a6cc71963c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b58508449aaa677fa96585967271755c69bcbd5306a76e4b4cc4737bab2f65a62603dc2ff00d7536d5915d50de79511bd8e559a60194145807eed28184581655
|
7
|
+
data.tar.gz: 08986ce8976280d214240cc20c8c219e7bf6bbcd86a88d0e972f1a35b39476d3f05105c1d0046a8101318d1f9b408e003eea1d59d190e22f91847c758841037b
|
@@ -76,7 +76,9 @@ module ActiveRecord
|
|
76
76
|
if conflict_do == :nothing
|
77
77
|
sql << " DO NOTHING"
|
78
78
|
else
|
79
|
-
|
79
|
+
primary_keys = Array(schema_cache.primary_keys(table_name)).map(&method(:quote_column_name))
|
80
|
+
updatable_keys = key_list - conflict_columns - primary_keys
|
81
|
+
sql << " DO UPDATE SET #{updatable_keys.map { |key| "#{key} = excluded.#{key}" }.join(", ")}"
|
80
82
|
end
|
81
83
|
end
|
82
84
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-insert_many
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Booth
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-09-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|