cohortly 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/cohortly/report.rb +2 -2
- data/lib/cohortly/version.rb +1 -1
- data/test/cohortly_test.rb +1 -0
- data/test/dummy/log/development.log +32 -0
- metadata +2 -2
@@ -45,8 +45,8 @@ module Cohortly
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def user_count_in_cohort(report_key)
|
48
|
-
params = { :user_start_date => { :$gt => key_to_time(report_key),
|
49
|
-
:$lt => (key_to_time(report_key)
|
48
|
+
params = { :user_start_date => { :$gt => key_to_time(report_key) - self.offset,
|
49
|
+
:$lt => (key_to_time(report_key))}}
|
50
50
|
params[:tags] = { :$in => groups } if self.groups
|
51
51
|
Cohortly::Metric.collection.distinct(:user_id, params).length
|
52
52
|
end
|
data/lib/cohortly/version.rb
CHANGED
data/test/cohortly_test.rb
CHANGED
@@ -90,6 +90,7 @@ class CohortlyTest < ActiveSupport::TestCase
|
|
90
90
|
time = DateTime.strptime('2011-08', '%Y-%W').utc
|
91
91
|
assert_equal report.key_to_time('2011-08'), time
|
92
92
|
assert_equal report.key_to_time(report.time_to_key(time)), time
|
93
|
+
|
93
94
|
|
94
95
|
assert_equal report.time_to_key(Time.utc(2011,8)), '2011-31'
|
95
96
|
assert_equal report.time_to_key(Time.utc(2011,1)), '2011-00'
|
@@ -8936,3 +8936,35 @@ Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/metrics/_metric.ht
|
|
8936
8936
|
Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/metrics/_pagination.html.erb (0.8ms)
|
8937
8937
|
Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/metrics/index.html.erb within layouts/cohortly/application (23.8ms)
|
8938
8938
|
Completed 200 OK in 46ms (Views: 28.3ms)
|
8939
|
+
|
8940
|
+
|
8941
|
+
Started GET "/cohortly/reports" for 127.0.0.1 at 2011-10-24 00:02:47 -0700
|
8942
|
+
Processing by Cohortly::ReportsController#index as HTML
|
8943
|
+
Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/metrics/_groups.html.erb (0.9ms)
|
8944
|
+
Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/metrics/_tags.html.erb (9.2ms)
|
8945
|
+
Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/reports/index.html.erb within layouts/cohortly/application (70.4ms)
|
8946
|
+
Completed 200 OK in 252ms (Views: 148.7ms)
|
8947
|
+
|
8948
|
+
|
8949
|
+
Started GET "/cohortly/reports.js?utf8=%E2%9C%93" for 127.0.0.1 at 2011-10-24 00:02:51 -0700
|
8950
|
+
Processing by Cohortly::ReportsController#index as JS
|
8951
|
+
Parameters: {"utf8"=>"✓"}
|
8952
|
+
Completed 200 OK in 158ms (Views: 96.8ms)
|
8953
|
+
|
8954
|
+
|
8955
|
+
Started GET "/cohortly/reports.js?utf8=%E2%9C%93&cohortly_metric%5Bgroups%5D%5B%5D=rand_0" for 127.0.0.1 at 2011-10-24 00:03:15 -0700
|
8956
|
+
Processing by Cohortly::ReportsController#index as JS
|
8957
|
+
Parameters: {"utf8"=>"✓", "cohortly_metric"=>{"groups"=>["rand_0"]}}
|
8958
|
+
Completed 200 OK in 132ms (Views: 67.6ms)
|
8959
|
+
|
8960
|
+
|
8961
|
+
Started GET "/cohortly/reports.js?utf8=%E2%9C%93" for 127.0.0.1 at 2011-10-24 00:03:38 -0700
|
8962
|
+
Processing by Cohortly::ReportsController#index as JS
|
8963
|
+
Parameters: {"utf8"=>"✓"}
|
8964
|
+
Completed 200 OK in 193ms (Views: 96.4ms)
|
8965
|
+
|
8966
|
+
|
8967
|
+
Started GET "/cohortly/reports.js?utf8=%E2%9C%93&cohortly_metric%5Btags%5D%5B%5D=weekly" for 127.0.0.1 at 2011-10-24 00:07:58 -0700
|
8968
|
+
Processing by Cohortly::ReportsController#index as JS
|
8969
|
+
Parameters: {"utf8"=>"✓", "cohortly_metric"=>{"tags"=>["weekly"]}}
|
8970
|
+
Completed 200 OK in 235ms (Views: 132.5ms)
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: cohortly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Bruce Hauman
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-10-
|
13
|
+
date: 2011-10-24 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|