summaryrefslogtreecommitdiff
path: root/lib/extensions
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-07-08 10:23:05 +0200
committerAzul <azul@leap.se>2014-07-14 10:49:39 +0200
commitfaa31affa8207305e9826e805c3bc08fbe83dd65 (patch)
treea846e46e0a85620f3c95408c59c3e803b4d187c5 /lib/extensions
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')
-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