rails_warden 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.5
1
+ 0.2.6
data/lib/rails_warden.rb CHANGED
@@ -53,20 +53,19 @@ if defined?(Rails)
53
53
  end
54
54
  end
55
55
 
56
- # Session Serialization in. This block determines how the user will
57
- # be stored in the session. If you're using a complex object like an
58
- # ActiveRecord model, it is not a good idea to store the complete object.
59
- # An ID is sufficient
60
- Warden::Manager.serialize_into_session{ |user| [user.class, user.id] }
56
+ class Warden::Serializers::Session
57
+ def serialize(user)
58
+ [user.class, user.id]
59
+ end
61
60
 
62
- # Session Serialization out. This block gets the user out of the session.
63
- # It should be the reverse of serializing the object into the session
64
- Warden::Manager.serialize_from_session do |klass, id|
65
- klass = case klass
66
- when Class
67
- klass
68
- when String, Symbol
69
- klass.to_s.classify.constantize
61
+ def deserialize(key)
62
+ klass, id = key
63
+ klass = case klass
64
+ when Class
65
+ klass
66
+ when String, Symbol
67
+ klass.to_s.classify.constantize
68
+ end
69
+ klass.find(id)
70
70
  end
71
- klass.find(id)
72
71
  end
data/rails_warden.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rails_warden}
8
- s.version = "0.2.5"
8
+ s.version = "0.2.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Daniel Neighman"]
12
- s.date = %q{2009-11-17}
12
+ s.date = %q{2009-12-07}
13
13
  s.description = %q{A gem that provides authenitcation via the Warden framework}
14
14
  s.email = %q{has.sox@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_warden
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Neighman
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-17 00:00:00 +11:00
12
+ date: 2009-12-07 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies: []
15
15