cohort_analysis 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,4 +1,10 @@
1
- unreleased
1
+ 1.0.3 / 2012-06-06
2
+
3
+ * Bug fixes
4
+
5
+ * Properly handle range conditions
6
+
7
+ 1.0.2 / 2012-06-06
2
8
 
3
9
  * Enhancements
4
10
 
@@ -85,7 +85,7 @@ module CohortAnalysis
85
85
  def grasp(subset)
86
86
  subset.map do |k, v|
87
87
  case v
88
- when Array
88
+ when Array, Range
89
89
  table[k].in v
90
90
  else
91
91
  table[k].eq v
@@ -1,3 +1,3 @@
1
1
  module CohortAnalysis
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
@@ -51,6 +51,15 @@ shared_examples_for 'an adapter the provides #cohort' do
51
51
  assert_count 1, model.cohort(:dest => ['MSN','SFO'])
52
52
  end
53
53
 
54
+ it "handles ranges of values" do
55
+ FactoryGirl.create(:lax_ord, :year => 20)
56
+ FactoryGirl.create(:lax_ord, :year => 15)
57
+ FactoryGirl.create(:lax_ord, :year => 10)
58
+ assert_count 3, model.cohort(:year => 10..20)
59
+ assert_count 2, model.cohort(:year => 11..20)
60
+ assert_count 1, model.cohort(:year => 11..19)
61
+ end
62
+
54
63
  it "matches everything if empty characteristics" do
55
64
  FactoryGirl.create(:lax_ord)
56
65
  FactoryGirl.create(:lax_sfo)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cohort_analysis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: