Closed maser closed 10 years ago
Sorry, I should have read the Rails docs more carefully!
@max-power The exception still happens though when the attribute is nil
. There should be a validation error instead of an exception when the value is nil
.
alright, with commit 8549dceca7392c9fc573b61fbc39676974d32909 the value you pass will be converted to a string first. please try it and give feedback.
Perfect! Thanks for your work on this gem, it saved me a lot of time.
you are very welcome.
If the attribute value is
nil
, validation fails with aNoMethodError
. As the IBAN attribute might be optional in the model where the validation is used, I changed it to allownil
as a value instead of adding an error.To validate presence, the user can still do
validates presence: true, iban: true