sferik/rails_admin — pull request #1387 by sauliusg (2012-11-10 20:51:36+00:00)
Title: Use #presence when fetching field's value.

Hi,

I encountered an exception when trying to display IPAddr field in show view. That happens because of IPAddr#<=> implementation (see http://www.ruby-doc.org/stdlib-1.9.3/libdoc/ipaddr/rdoc/IPAddr.html#method-i-3C-3D-3E).

```ruby
irb(main):006:0> ip = IPAddr.new('127.0.0.1')
=> #
irb(main):007:0> ip != []
NoMethodError: undefined method `to_i' for []:Array
irb(main):008:0> ip != ''
ArgumentError: invalid address
```

I suspect there may be other classes (custom or in stdlib) that may be affected by this. ActiveSupport's #presence, based on #blank? seems to yield the expected result.