Manual type cast in rails 4.2

Hello all,

Before rails 4.2, I could write: ActiveRecord::ConnectionAdapters::Column.new(:dummy, nil, type.to_s).type_cast(value)

To type cast value to type, but now that API seems to have changed a lot. How can I do it now?

cheers,

bráulio

Question on http://stackoverflow.com/questions/29441796/manual-type-cast-in-rails-4-2

data_type = :integer.to_s.camelize
ActiveRecord::Type.const_get(data_type).new.send :cast_value, "50.0"