Use `IPAddr#prefix` for postgres cidr type
`IPAddr#prefix` was added in https://github.com/ruby/ipaddr/commit/293ad5ac6ed704f91d418ecaf24ae58156a5 and imported into Ruby 2.5 in https://github.com/ruby/ruby/commit/c2db917b3db09e3738529d5a45315b77d12ae4c3 Since Rails now uses Ruby >= 2.5 we can safely rely on `IPAddr#prefix` instead of reaching into instance variables.
Showing
想要评论请 注册 或 登录