Object stored in Rails session becomes a String?
问题 Normally I wouldn't store objects in a Rails session but I'm using a library that requires this. I've run into a very strange issue where a stored object appears as a String after redirect. To reproduce I've created a sample Rails 4.1 app $ rails new session-test Added a test controller: class HomeController < ApplicationController def index logger.debug "session[:customer]: #{session[:customer]}" logger.debug "session[:customer].name: #{session[:customer].name}" end def from Struct.new