summaryrefslogtreecommitdiff
path: root/users/lib/warden/session_serializer.rb
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2012-11-12 10:48:40 -0800
committerjessib <jessib@riseup.net>2012-11-12 10:48:40 -0800
commit347c1d73c855cfad8c37e8a0bd98a60831151812 (patch)
tree104c89712d9a1f7d7eefd49187a2f6bbc70a33ce /users/lib/warden/session_serializer.rb
parent67cb22d50193a58e4697549d9ce8a22e790a7a0d (diff)
parentfe8b49232d31681667badaaeff7aa4d0a40445ea (diff)
Merge branch 'develop' into help_develop
Conflicts: help/test/functional/tickets_controller_test.rb users/test/functional/application_controller_test.rb users/test/support/auth_test_helper.rb
Diffstat (limited to 'users/lib/warden/session_serializer.rb')
-rw-r--r--users/lib/warden/session_serializer.rb13
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