Ran
|
Jobs
16
|
Files
153
|
Run time
18min
|
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.
2 of 2 new or added lines in 1 file covered. (100.0%)
4056 of 4339 relevant lines covered (93.48%)
21585.84 hits per line
Lines | Coverage | ∆ | File |
---|---|---|---|
1 |
86.96 |
-3.04% | lib/rails_admin/config/fields/types/enum.rb |
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|