diff options
author | Azul <azul@leap.se> | 2012-11-12 19:16:55 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2012-11-12 19:16:55 +0100 |
commit | c886cc17b6f37ddd556e70fe2d76a3ea28db52bf (patch) | |
tree | e27fe040bfaba5840730f466d4c6f90213759d5e /users/lib/warden/session_serializer.rb | |
parent | ca2e1b9f379ccba068ad0ebb852d855f1639cd3a (diff) | |
parent | 5b300b554682c232c0955bdb0dd3d8263dde901e (diff) |
Merge branch 'feature-warden-srp' into develop
Diffstat (limited to 'users/lib/warden/session_serializer.rb')
-rw-r--r-- | users/lib/warden/session_serializer.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/users/lib/warden/session_serializer.rb b/users/lib/warden/session_serializer.rb new file mode 100644 index 0000000..81d7076 --- /dev/null +++ b/users/lib/warden/session_serializer.rb @@ -0,0 +1,13 @@ +module Warden + # Setup Session Serialization + class SessionSerializer + def serialize(record) + [record.class.name, record.id] + end + + def deserialize(keys) + klass, id = keys + klass.constantize.find(id) + end + end +end |