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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c47d454d68dbeb13a19af73d5ea67e82093a7f7
4
- data.tar.gz: b6de1499660943410dd9f8c293d5ac3a1d99c0dd
3
+ metadata.gz: 397b58e2e8ed6c6c747f9ac04885cf7040152e83
4
+ data.tar.gz: 99f0d69e4f45a7c000325268e4d63bec53af8941
5
5
  SHA512:
6
- metadata.gz: cb7827d0b7fe557ae9988ce6145db9f28ad0a62ec4773c0c8e55558b5b26a007f3d487fee966252ad819182eb2caa228897b41b198eecf57eae424a86e11e4e4
7
- data.tar.gz: a3821524471837e9f7d6fc4a4016d39abd733aaa0f0c9036932d2edfc27f810b8fb55d3a1364e070808c05ddc929cfe052d1a1bba9fd899799f8cea4a6adaafb
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.4'],
24
- ['sportdb-models', '>= 2.0.0'],
23
+ ['sportdb-config', '>= 1.1.0'],
24
+ ['sportdb-models', '>= 2.0.1'],
25
25
  ]
26
26
 
27
27
  self.spec_extras = {
@@ -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
@@ -6,8 +6,8 @@ module Module
6
6
  module Sync
7
7
 
8
8
  MAJOR = 1 ## todo: namespace inside version or something - why? why not??
9
- MINOR = 0
10
- PATCH = 3
9
+ MINOR = 1
10
+ PATCH = 0
11
11
  VERSION = [MAJOR,MINOR,PATCH].join('.')
12
12
 
13
13
  def self.version
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.3
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-05-24 00:00:00.000000000 Z
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.4
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.4
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.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.0
40
+ version: 2.0.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rdoc
43
43
  requirement: !ruby/object:Gem::Requirement