• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sferik / rails_admin / 1573 / 16
96%
master: 96%

Build:
DEFAULT BRANCH: master
Ran 24 Oct 2014 04:12PM UTC
Files 112
Run time 54s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Oct 2014 03:58PM UTC coverage: 82.741%. First build
2.1, RAILS_VERSION=4.0 CI_ORM=mongoid

Pull #2098

travis-ci

p3drosola
<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">&quot;&gt;Don&amp;#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&amp;#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&#39;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.
Pull Request #2098: Use nil as the emtpy value of enums

2493 of 3013 relevant lines covered (82.74%)

386.81 hits per line

Source Files on job 1573.16 (2.1, RAILS_VERSION=4.0 CI_ORM=mongoid)
  • Tree
  • List 0
  • Changed 74
  • Source Changed 1
  • Coverage Changed 74
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1573
  • Travis Job 1573.16
  • b5e81dfa on github
  • Prev Job for 2.1, RAILS_VERSION=4.0 CI_ORM=mongoid on master (#1570.16)
  • Next Job for 2.1, RAILS_VERSION=4.0 CI_ORM=mongoid on master (#1574.16)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc