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