summaryrefslogtreecommitdiff
path: root/lib/extensions/warden.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-07-08 10:23:05 +0200
committerAzul <azul@leap.se>2014-07-15 12:12:51 +0200
commitff697316c85f9edc5a568d66f6c92ff6d13862cc (patch)
treea846e46e0a85620f3c95408c59c3e803b4d187c5 /lib/extensions/warden.rb
parentdc2006af6a571bdebde5647f5b36751f013c772a (diff)
rename warden extension to patch the original
the Warden::SessionSerializer was not getting loaded at all because we had a file by the same name. We want it to get loaded and be patched instead.
Diffstat (limited to 'lib/extensions/warden.rb')
-rw-r--r--lib/extensions/warden.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/extensions/warden.rb b/lib/extensions/warden.rb
new file mode 100644
index 0000000..81d7076
--- /dev/null
+++ b/lib/extensions/warden.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