Open marten opened 10 years ago
I like this, especially since we could actually make the validations compatible:
def validate_integer_string param_name, param
return if param.is_a?(String) && /\A\d+\Z/.match(param)
errors.add param_name.to_s, "should be an integer string."
end
That way we could decouple this functionality introduction from removing calls to validation helpers, allowing us to first upgrade, and then one by one remove old validations.
The actual API is also up for debate, so feel free to have better ideas than just using ActiveModel::Errors. The new README proposes: