metry 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ === 2.1.1 / 2009-08-13
2
+
3
+ * Handled illegal/missing visitor id.
4
+
1
5
  === 2.1.0 / 2009-08-13
2
6
 
3
7
  * Added experiment/cohort analysis.
@@ -11,7 +11,7 @@ require 'metry/cohort'
11
11
  require 'metry/psycho'
12
12
 
13
13
  module Metry
14
- VERSION = '2.1.0'
14
+ VERSION = '2.1.1'
15
15
 
16
16
  def self.init(dbname)
17
17
  MongoMapper.database = dbname
@@ -40,7 +40,11 @@ module Metry
40
40
  def find_or_create_visitor(request)
41
41
  visitor = nil
42
42
  if id = request.cookies[COOKIE]
43
- visitor = Visitor.find(id)
43
+ begin
44
+ visitor = Visitor.find(id)
45
+ rescue MongoMapper::IllegalID, MongoMapper::DocumentNotFound
46
+ visitor = nil
47
+ end
44
48
  end
45
49
  (visitor || Visitor.create)
46
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metry
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathaniel Talbott