summaryrefslogtreecommitdiff
path: root/lib/warden/session_serializer.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-04-08 14:22:56 +0200
committerAzul <azul@leap.se>2014-04-08 14:30:07 +0200
commit9776dd10fc60efde38946588d0955c406f6c1f5e (patch)
treea77a83984e39a72cd1bb2f8f89c6d9646de117d7 /lib/warden/session_serializer.rb
parentb6d14dc19dd350a807826e3e097738a36613e083 (diff)
move users: config and lib
Diffstat (limited to 'lib/warden/session_serializer.rb')
-rw-r--r--lib/warden/session_serializer.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/warden/session_serializer.rb b/lib/warden/session_serializer.rb
new file mode 100644
index 0000000..81d7076
--- /dev/null
+++ b/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