cohortly 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,8 +2,11 @@ class Cohortly::ReportsController < Cohortly::CohortlyController
2
2
  def index
3
3
  @metric_search = Cohortly::Metric.new(params[:cohortly_metric])
4
4
  tags = @metric_search.tags.any? ? @metric_search.tags : nil
5
- Cohortly::Metric.cohort_chart_for_tag(tags)
6
- @report = Cohortly::Report.new( Cohortly::Metric.report_table_name(tags) )
5
+ report_name = Cohortly::Metric.report_table_name(tags)
6
+ unless Cohortly::Metric.database.collections.collect(&:name).include?( report_name )
7
+ Cohortly::Metric.cohort_chart_for_tag(tags)
8
+ end
9
+ @report = Cohortly::Report.new( report_name )
7
10
  end
8
11
 
9
12
  end
@@ -34,7 +34,7 @@ module Cohortly
34
34
  end
35
35
 
36
36
  def self.report_table_name(tags = nil)
37
- "cohort_report#{ tags ? "_#{ tags.sort.join('_') }" : '' }"
37
+ "cohort_report#{ tags ? "_#{ tags.sort.join('_') }" : '' }_#{ Time.now.strftime("%m-%d-%Y") }"
38
38
  end
39
39
 
40
40
  def self.month_map
@@ -1,3 +1,3 @@
1
1
  module Cohortly
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -6340,3 +6340,37 @@ Started GET "/cohortly/reports?utf8=%E2%9C%93&cohortly_metric%5Btags%5D%5B%5D=he
6340
6340
  Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/metrics/_tags.html.erb (5.8ms)
6341
6341
  Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/reports/index.html.erb within layouts/cohortly/application (24.9ms)
6342
6342
  Completed 200 OK in 74ms (Views: 31.0ms)
6343
+
6344
+
6345
+ Started GET "/" for 127.0.0.1 at 2011-10-05 23:21:34 -0700
6346
+ Processing by StuffController#index as HTML
6347
+ Rendered stuff/index.html.erb within layouts/application (1.5ms)
6348
+ Completed 200 OK in 198ms (Views: 151.0ms)
6349
+
6350
+
6351
+ Started GET "/cohortly/reports" for 127.0.0.1 at 2011-10-05 23:21:38 -0700
6352
+ Processing by Cohortly::ReportsController#index as HTML
6353
+ Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/metrics/_tags.html.erb (5.7ms)
6354
+ Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/reports/index.html.erb within layouts/cohortly/application (147.4ms)
6355
+ Completed 200 OK in 3228ms (Views: 210.7ms)
6356
+
6357
+
6358
+ Started GET "/cohortly/reports" for 127.0.0.1 at 2011-10-05 23:21:45 -0700
6359
+ Processing by Cohortly::ReportsController#index as HTML
6360
+ Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/metrics/_tags.html.erb (5.5ms)
6361
+ Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/reports/index.html.erb within layouts/cohortly/application (155.8ms)
6362
+ Completed 200 OK in 174ms (Views: 160.1ms)
6363
+
6364
+
6365
+ Started GET "/cohortly/reports" for 127.0.0.1 at 2011-10-05 23:21:53 -0700
6366
+ Processing by Cohortly::ReportsController#index as HTML
6367
+ Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/metrics/_tags.html.erb (5.6ms)
6368
+ Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/reports/index.html.erb within layouts/cohortly/application (129.5ms)
6369
+ Completed 200 OK in 148ms (Views: 134.0ms)
6370
+
6371
+
6372
+ Started GET "/cohortly/reports" for 127.0.0.1 at 2011-10-05 23:21:55 -0700
6373
+ Processing by Cohortly::ReportsController#index as HTML
6374
+ Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/metrics/_tags.html.erb (5.4ms)
6375
+ Rendered /Users/bhauman/workspace/cohortly/app/views/cohortly/reports/index.html.erb within layouts/cohortly/application (127.4ms)
6376
+ Completed 200 OK in 170ms (Views: 131.9ms)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cohortly
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Bruce Hauman