• Drew Blessing's avatar
    Add validator for IP address/inet columns · 12938361
    Drew Blessing authored
    When using column type `inet` Rails will silently return the value
    as `nil` when the value is not valid according to its type cast
    using `IpAddr`. It's not very user friendly to return an error
    "IP Address can't be blank" when a value was clearly given but
    was not the right format. This validator will look at the value
    before Rails type casts it when the value itself is `nil`.
    This enables the validator to return a specific and useful error
    message.
    12938361
audit_event_spec.rb 622 Bytes