Add a model for sessions.
authorTom Hughes <tom@compton.nu>
Thu, 9 Aug 2007 23:21:17 +0000 (23:21 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 9 Aug 2007 23:21:17 +0000 (23:21 +0000)
app/models/session.rb [new file with mode: 0644]

diff --git a/app/models/session.rb b/app/models/session.rb
new file mode 100644 (file)
index 0000000..619a7a7
--- /dev/null
@@ -0,0 +1,7 @@
+class Session < ActiveRecord::Base
+  def [](key)
+    @data = Marshal.load(Base64.decode64(self.data)) unless @data
+
+    return @data[key]
+  end
+end