Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Commit

Permalink
Update README code sample with new serializer type
Browse files Browse the repository at this point in the history
  • Loading branch information
HP authored and Daniel Neighman committed Jan 20, 2010
1 parent 7159abb commit 7e77c47
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.textile
Expand Up @@ -21,8 +21,16 @@ config/initializers/warden.rb
end

# Setup Session Serialization
Warden::Manager.serialize_into_session{ |user| [user.class, user.id] }
Warden::Manager.serialize_from_session{ |klass, id| klass.find(id) }
class Warden::SessionSerializer
def serialize(record)
[record.class, record.id]
end

def deserialize(keys)
klass, id = keys
klass.find(:first, :conditions => { :id => id })
end
end

# Declare your strategies here
#Warden::Strategies.add(:my_strategy) do
Expand Down

0 comments on commit 7e77c47

Please sign in to comment.