radiant-race_results-extension 1.4.5 → 1.4.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,14 +12,13 @@ class RaceCheckpointTime < ActiveRecord::Base
12
12
  alias :performance :race_performance
13
13
  alias :checkpoint :race_checkpoint
14
14
 
15
- default_scope :include => [:race_performance, :race_checkpoint]
15
+ # default_scope :include => [:race_performance, :race_checkpoint]
16
16
  before_save :calculate_interval # position would be nice too but we may not have imported all the data at this stage
17
17
 
18
18
  named_scope :with_context, :include => [:race_performance, :race_checkpoint]
19
19
  named_scope :by_time, { :order => 'race_checkpoint_times.elapsed_time' }
20
20
  named_scope :by_interval, { :order => 'race_checkpoint_times.interval' }
21
21
 
22
-
23
22
  named_scope :single, lambda { |offset|
24
23
  {
25
24
  :limit => 1,
@@ -52,6 +51,10 @@ class RaceCheckpointTime < ActiveRecord::Base
52
51
  }
53
52
  }
54
53
 
54
+ named_scope :other_than_finish, {
55
+ :joins => "INNER JOIN race_checkpoints as checkpoints ON race_checkpoint_times.race_checkpoint_id = checkpoints.id",
56
+ :conditions => ["NOT checkpoints.name = ?", "Finish"]
57
+ }
55
58
 
56
59
  def to_s
57
60
  time = read_attribute(:elapsed_time)
@@ -77,7 +77,7 @@ class RaceInstance < ActiveRecord::Base
77
77
  end
78
78
 
79
79
  def splits_available?
80
- RaceCheckpointTime.in(self).any?
80
+ RaceCheckpointTime.in(self).other_than_finish.any?
81
81
  end
82
82
 
83
83
  def assembled_checkpoint_times
@@ -1,5 +1,5 @@
1
1
  module RadiantRaceResultsExtension
2
- VERSION = '1.4.5'
2
+ VERSION = '1.4.6'
3
3
  SUMMARY = %q{Race results analysis and presentation for the Radiant CMS}
4
4
  DESCRIPTION = %q{Makes easy the uploading, analysis and display of race results. Built for fell races but should work for most timed or score events.}
5
5
  URL = "http://spanner.org/radiant/race_results"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-race_results-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 4
9
- - 5
10
- version: 1.4.5
9
+ - 6
10
+ version: 1.4.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - William Ross
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-16 00:00:00 Z
18
+ date: 2011-11-17 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: radiant-layouts-extension
@@ -236,7 +236,7 @@ files:
236
236
  homepage: http://spanner.org/radiant/race_results
237
237
  licenses: []
238
238
 
239
- post_install_message: "\n Add this to your radiant project with:\n\n config.gem 'radiant-race_results-extension', :version => '~> 1.4.5'\n\n "
239
+ post_install_message: "\n Add this to your radiant project with:\n\n config.gem 'radiant-race_results-extension', :version => '~> 1.4.6'\n\n "
240
240
  rdoc_options: []
241
241
 
242
242
  require_paths: