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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a99e7af845eb71839bb8ea359d658ea027e1b260
4
- data.tar.gz: 21cf9fa3a7cb668ecbef0c8045b2e4b61c5e089f
3
+ metadata.gz: c276d0eee5e5db657eb940399291c313f4d2c484
4
+ data.tar.gz: 315611a8944094f2180c5047ab361878a12747c7
5
5
  SHA512:
6
- metadata.gz: be59050806901dab5b6c6a92d2fe8b1c444d38bcff2a622b43a44742d5ab4ee89786c61803e661ab0519f8a808fc4f63183f030490ab9bfc3289ff9aea3f761b
7
- data.tar.gz: 39b87a3eb721882aa46a10e5728ac3412bcb1ec67db7b93e91d1810cb935dbdcbaf4974abd4b7341dd1edee174fc7861afb13f111c7752ff4a05c1c4ccc6faa1
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
- klass.connection.execute(insert.to_sql)
32
- rescue ArgumentError
33
- # If we can't generate the insert using Arel (likely because
34
- # of an issue with a serialized attribute) then fall back
35
- # to safe but slow behaviour.
36
- klass.new(data).save(validate: false)
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
 
@@ -1,3 +1,3 @@
1
1
  class Tachyon
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tachyon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Gough