|
Ran
|
Files
112
|
Run time
54s
|
Badge
README BADGES
|
travis-ci
<a href="https://github.com/sferik/rails_admin/commit/<a class=hub.com/sferik/rails_admin/commit/b5e81dfa28b749ba2a49a969512f96e94233cd57">b5e81dfa2<a href="https://github.com/sferik/rails_admin/commit/b5e81dfa28b749ba2a49a969512f96e94233cd57">">Don&#39;t save an empty string as the nil value of enums When configuring a field as an enum, rails_admin automatically adds a nil option. However, when parsing the input, it&#39;s picked up as an empty string. See: https://github.com/sferik/rails_admin/commit/</a><a class="double-link" href="https://github.com/sferik/rails_admin/commit/<a class="double-link" href="https://github.com/sferik/rails_admin/commit/ac0344fc7f52bb3fc55b57dd9d0ec8937e7b7143">ac0344fc7</a>">ac0344fc7</a><a href="https://github.com/sferik/rails_admin/commit/b5e81dfa28b749ba2a49a969512f96e94233cd57"> By mapping the empty value to nil, we ensure compatibility with the new [ActiveRecord::Enum](http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html) and [mongoid-enum](https://github.com/thetron/mongoid-enum), which make special allowances in their validations for nil values, but not empty strings. One last thing we could add is to allow an empty string, if it's one of the values specified in the `enum`. But I'm not really familiar with the scopes involved, so I won't add that.
2493 of 3013 relevant lines covered (82.74%)
386.81 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|