activerecord-import 0.14.0 → 0.14.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0eab7d65f5982398dc619a9b74658f8686fca73
|
4
|
+
data.tar.gz: e2eee39f139a44acf97c11f84a834c70e1833418
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b12aea6f47a5f45920c58a227a1f62f445f9fb7f33e7226c17c1c3c0bfc0d680bac38d24342bcb3aa847f46c15cddfa1a8f10cc9e946ca0ba52e0ea43afced7
|
7
|
+
data.tar.gz: 7ebeae0718cc45a693d986db6f544eadad3c10dcff580403634afbbcd87074cca999a67cf960ed5bb0b438d77737cf09154b88ff701b1068c70cd3a4586a46c7
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,7 @@ module ActiveRecord::Import::PostgreSQLAdapter
|
|
6
6
|
|
7
7
|
def insert_many( sql, values, *args ) # :nodoc:
|
8
8
|
number_of_inserts = 1
|
9
|
+
ids = []
|
9
10
|
|
10
11
|
base_sql, post_sql = if sql.is_a?( String )
|
11
12
|
[sql, '']
|
@@ -14,7 +15,11 @@ module ActiveRecord::Import::PostgreSQLAdapter
|
|
14
15
|
end
|
15
16
|
|
16
17
|
sql2insert = base_sql + values.join( ',' ) + post_sql
|
17
|
-
|
18
|
+
if post_sql =~ /RETURNING\s/
|
19
|
+
ids = select_values( sql2insert, *args )
|
20
|
+
else
|
21
|
+
insert( sql2insert, *args )
|
22
|
+
end
|
18
23
|
|
19
24
|
ActiveRecord::Base.connection.query_cache.clear
|
20
25
|
|