# class Warden::SessionSerializer

### Public Instance Methods

deserialize(keys) click to toggle source

    # File lib/devise/rails/warden_compat.rb, line 23
    def deserialize(keys)
      klass, *args = keys

      begin
        ActiveSupport::Inflector.constantize(klass).serialize_from_session(*args)
      rescue NameError => e
        if e.message =~ %runinitialized constant/
          Rails.logger.debug "[Devise] Trying to deserialize invalid class #{klass}"
          nil
        else
          raise
        end
      end
    end

serialize(record) click to toggle source

    # File lib/devise/rails/warden_compat.rb, line 17
    def serialize(record)
      klass = record.class
      array = klass.serialize_into_session(record)
      array.unshift(klass.name)
    end