Force the state model stub to serialize.

We are calling update_attribute on a state object where the :data value is a hash.

s.update_attribute(:data, data)

where data:
```
"{:advanced_settings=>[{:id=>447000000001757, :name=>\"VMkernel.Boot.com2_baud\", :value=>\"115200\"...
```

In Rails 4.2 this results in s.data:
```
"\"{:advanced_settings=>[{:id=>447000000001757, :name=>\\\"VMkernel.Boot.com2_baud\\\", :value=>\\\"115200\\\"...
```

Apparently this worked in Rails 3.2 since the string was not quoted and escaped.
In Rails 4.2, reflections returns an array of Strings!

So, this is probably not the way to fix this but it's a temporary hack to get things working.
Typecast the xml string data as if it were coming from the database.

col.type_cast_for_database("true")  => "true"  # Not what we want
col.type_cast_from_database("true") => true
Pass AR types mapped from simplified ones into the Column for casting.

See AR types here: https://github.com/rails/rails/tree/4-2-stable/activerecord/lib/active_record/type
ActiveRecord::ConnectionAdapters::Column or it's consumers are expecting a cast type that can respond to type_cast_from_database and friends.