logeater 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logeater/request.rb +13 -0
- data/lib/logeater/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: ee9771f19fbb6a41d6a072d2f1a1fb8280cdcce7
|
4
|
+
data.tar.gz: 2b82746a2c79e407ef544a1472ad31826a9f2587
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da4a22896028c127870e05217d3c9125dc73ddc9e28b00afa4dea52d8dca980240ace54dba9f1aaf08d0a628aff861e423957f5080b5774a627a30db7653cdea
|
7
|
+
data.tar.gz: d12c10c9df5a1a26fc1bcc36adfc8fb276046c43ef23bfc469057de9c72f8e7759305c53f576678667ecdaf3a452019289001f7cf9b78b53246122a2b8993f7c
|
data/lib/logeater/request.rb
CHANGED
@@ -5,5 +5,18 @@ module Logeater
|
|
5
5
|
class Request < ActiveRecord::Base
|
6
6
|
self.table_name = "requests"
|
7
7
|
|
8
|
+
def self.import(values)
|
9
|
+
# values have to be unique by uuid
|
10
|
+
values = values.uniq { |request| request.uuid }
|
11
|
+
|
12
|
+
super values
|
13
|
+
rescue PG::UniqueViolation, ActiveRecord::RecordNotUnique
|
14
|
+
# try again after skipping requests with existing uuids
|
15
|
+
existing_uuids = where(uuid: values.map(&:uuid)).pluck(:uuid)
|
16
|
+
values = values.reject { |request| existing_uuids.member?(request.uuid) }
|
17
|
+
|
18
|
+
super values
|
19
|
+
end
|
20
|
+
|
8
21
|
end
|
9
22
|
end
|
data/lib/logeater/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logeater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Lail
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|