tachyon 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tachyon.rb +10 -6
- data/lib/tachyon/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: c276d0eee5e5db657eb940399291c313f4d2c484
|
4
|
+
data.tar.gz: 315611a8944094f2180c5047ab361878a12747c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebe9de2b0f4fc089db590d122e0c1367a32937e1ed9cf7d7ebed3490020f883055825770487a48fd0ae8b53c39d063faac63adec8af940729c939825464de849
|
7
|
+
data.tar.gz: 362fdeb31d82e0bf9d9fb533d07de05835ccad65a444dca07876cc5f2b99a22c5f4dc8637801dceae7e3998a8883d830b488c8f10c8c90fbfd5a948d01bddaa3
|
data/lib/tachyon.rb
CHANGED
@@ -23,17 +23,21 @@ class Tachyon
|
|
23
23
|
[table[key], value]
|
24
24
|
end
|
25
25
|
|
26
|
+
|
26
27
|
insert = Arel::InsertManager.new
|
27
28
|
insert.into(table)
|
28
29
|
insert.insert(mapped_data)
|
29
30
|
|
30
31
|
begin
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
begin
|
33
|
+
klass.connection.execute(insert.to_sql)
|
34
|
+
rescue ArgumentError
|
35
|
+
# If we can't generate the insert using Arel (likely because
|
36
|
+
# of an issue with a serialized attribute) then fall back
|
37
|
+
# to safe but slow behaviour.
|
38
|
+
klass.new(data).save(validate: false)
|
39
|
+
end
|
40
|
+
rescue ActiveRecord::RecordNotUnique
|
37
41
|
end
|
38
42
|
end
|
39
43
|
|
data/lib/tachyon/version.rb
CHANGED