sportdb-sync 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +2 -2
- data/lib/sportdb/sync/sync.rb +12 -1
- data/lib/sportdb/sync/version.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 397b58e2e8ed6c6c747f9ac04885cf7040152e83
|
4
|
+
data.tar.gz: 99f0d69e4f45a7c000325268e4d63bec53af8941
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb1cb72c8ee98549af0ed85879ba8e5490afae58747a2ddd25356f3886e5d72672a0f1badda739baed05646e5b2ceceefe2f0b7a4bfb932ff6425a4a7dedccc6
|
7
|
+
data.tar.gz: 93cee1c25615d5fcce27b414f2bd964f411ddf3f110ca15863631c44ae38b14b11585e206dbd966a68f68391a1ae116cb5b584105f341a4f2ba38aa9565587df
|
data/Rakefile
CHANGED
@@ -20,8 +20,8 @@ Hoe.spec 'sportdb-sync' do
|
|
20
20
|
self.licenses = ['Public Domain']
|
21
21
|
|
22
22
|
self.extra_deps = [
|
23
|
-
['sportdb-config', '>= 1.0
|
24
|
-
['sportdb-models', '>= 2.0.
|
23
|
+
['sportdb-config', '>= 1.1.0'],
|
24
|
+
['sportdb-models', '>= 2.0.1'],
|
25
25
|
]
|
26
26
|
|
27
27
|
self.spec_extras = {
|
data/lib/sportdb/sync/sync.rb
CHANGED
@@ -165,12 +165,21 @@ module SportDb
|
|
165
165
|
nil
|
166
166
|
end
|
167
167
|
|
168
|
+
## check optional stage (e.g. Regular, Play Off, Relegation, etc. )
|
169
|
+
stage_rec = if match.stage
|
170
|
+
stage_name = match.stage.is_a?( String ) ? match.stage : match.stage.name
|
171
|
+
Model::Stage.find_by!( event_id: event.id,
|
172
|
+
name: stage_name )
|
173
|
+
else
|
174
|
+
nil
|
175
|
+
end
|
168
176
|
|
177
|
+
### todo/check: what happens if there's more than once match? exception raised??
|
169
178
|
rec = Model::Match.find_by( round_id: round_rec.id,
|
170
179
|
team1_id: team1_rec.id,
|
171
180
|
team2_id: team2_rec.id )
|
172
181
|
if rec.nil?
|
173
|
-
## find last pos - check if it can be nil?
|
182
|
+
## find last pos - check if it can be nil? yes, is nil if no records found
|
174
183
|
max_pos = Model::Match.where( event_id: event.id ).maximum( 'pos' )
|
175
184
|
max_pos = max_pos ? max_pos+1 : 1
|
176
185
|
|
@@ -184,7 +193,9 @@ module SportDb
|
|
184
193
|
score2: match.score2,
|
185
194
|
score1i: match.score1i,
|
186
195
|
score2i: match.score2i }
|
196
|
+
|
187
197
|
attribs[ :group_id ] = group_rec.id if group_rec
|
198
|
+
attribs[ :stage_id ] = stage_rec.id if stage_rec
|
188
199
|
|
189
200
|
rec = Model::Match.create!( attribs )
|
190
201
|
else
|
data/lib/sportdb/sync/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sportdb-sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sportdb-config
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0
|
19
|
+
version: 1.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0
|
26
|
+
version: 1.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sportdb-models
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.0.
|
33
|
+
version: 2.0.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.0.
|
40
|
+
version: 2.0.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rdoc
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|