case type
      when :boolean
        ActiveRecord::Type::Boolean.new.type_cast_from_user(attribute)
      when :integer
        ActiveRecord::Type::Integer.new.type_cast_from_user(attribute)