You can pass a class to serialize:
class User < ActiveRecord::Base
serialize :recent_messages, Array
end
The above ensures that recent_messages is an Array:
User.new
#=> #<User id: nil, recent_messages: [], created_at: nil, updated_at: nil>
Note that you might have to convert existing fields if the types don’t match.