In production mode, I keep getting this error the 2nd time it loads a
page with a serialized attribute:
ActiveRecord::SerializationTypeMismatch (answers_container was
supposed to be a Array, but was a NilClass):
In development, it works fine. In fact, if I set to false
config.cache_classes in production.rb, it works fine.
The first time you hit the page, it works fine. Upon refresh, it
returns that error.
This happens with both webbrick and litespeed.
The controller code is:
params[:my_id] = “survey” if
@question = Question.new
@question.answers_container = Array.new(2, “”)
@question.creator_message = current_user[:note] if logged_in?
In my model, I define the serialized attribute as such:
serialize :answers_container, Array
I was running rails 1.2, then upgraded to 1.2.2 after seeing I have
this problem. I believe when I was running 1.1.6 I did not have this
Does anyone have any suggestions?